当我尝试输入此代码时,Xcode 说我“使用了未声明的标识符 'completedWithResult'”。这是 Quickblox 上推送通知的代码。有一段代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
/// Set QuickBlox credentials (You must create application in admin.quickblox.com)
[QBSettings setApplicationID:XX];
[QBSettings setAuthorizationKey:@"XX"];
[QBSettings setAuthorizationSecret:@"XX"];
//
// If you use Push Notifications - you have to use lines bellow when you upload your application to Apple Store or create AdHoc.
//
[QBSettings useProductionEnvironmentForPushNotifications:YES];
QBASessionCreationRequest *extendedAuthRequest = [QBASessionCreationRequest request];
extendedAuthRequest.devicePlatorm = DevicePlatformiOS;
extendedAuthRequest.deviceUDID = [[UIDevice currentDevice] uniqueIdentifier];
extendedAuthRequest.userLogin = @"yourUserLogin";
extendedAuthRequest.userPassword = @"yourUserPassword";
[QBAuth createSessionWithExtendedRequest:extendedAuthRequest delegate:self];
// QuickBlox queries delegate
- (void)completedWithResult:(Result *)result{
if(result.success){
// Create session result
if([result isKindOfClass:QBAAuthSessionCreationResult.class]){
// register for receive push notifications
[QBMessages TRegisterSubscriptionWithDelegate:self];
// Register for receive push notifications result
}else if([result isKindOfClass:QBMRegisterSubscriptionTaskResult.class]){
// Congrats! Now you can receive Push Notifications!
}
}
}
错误在这一行:
// QuickBlox queries delegate
- (void)completedWithResult:(Result *)result{
if(result.success){
它说'使用未声明的标识符'completedWithResult''
请问有人可以帮忙吗?谢谢!