1

I am integrating openfient SDK in my app. When I want to submit user's score and called a function as below it is giving error 'OFDelegate' was not declared in this scope

[OFHighScoreService setHighScore:scores forLeaderboard:@"112033" onSuccess:OFDelegate() onFailure:OFDelegate()];

Please help me to shortout this issue.

Rais Alam
  • 6,970
  • 12
  • 53
  • 84
Shivomkara Chaturvedi
  • 1,697
  • 7
  • 28
  • 42

2 Answers2

2

This problem may occur when upgrading from an old version of open feint or reading an old post about Open Feint, as this method is no longer available, yet still compiles and runs.

The following lines will probably be enough to solve this problem:

[OFHighScoreService setHighScore:scores forLeaderboard:@"112033"
                 onSuccessInvocation:[OFInvocation invocationForTarget:nil selector:nil] 
                 onFailureInvocation:[OFInvocation invocationForTarget:nil selector:nil]];

Just don't forget to import:

#import "OFHighScoreService.h"
eladleb
  • 2,616
  • 26
  • 21
0

Make sure you have integrated OpenFeint SDK with your app. You may find this video useful: http://vimeo.com/5633994

piokuc
  • 25,594
  • 11
  • 72
  • 102
  • Do you have #import "OpenFeint.h" and #import "OpenFeintDelegate.h" in the file where you make a call to OFHighScoreService ? – piokuc Sep 28 '11 at 13:44
  • Yes please, I have imported both I think this method used in old version of SDK. Because this can be called if I import this file #import "OFDelegate.h" but this is not available in SDK. That i am using – Shivomkara Chaturvedi Sep 28 '11 at 13:51