B-HigH
B-HigH

Reputation: 11

Not able to call NewAPI for QuickBlox iOS 2.0+

I'm using Quickblox SDK and developing iOS based app.

Currently, I'm not able to use new API (block statement).
I have to use the deprecated one, delegate way.

This happened when I tried to call create session with NewAPI format

[QBRequest createSessionWithSuccessBlock:^(QBResponse *response, QBASession *session) {
    NSLog(@"Successfull response!");
} errorBlock:^(QBResponse *response) {
    NSLog(@"Response error: %@", response.error);
}];

It returned

+[QBRequest createSessionWithSuccessBlock:errorBlock:]: 
  unrecognized selector sent to class 0x2a5798  
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
  reason: '+[QBRequest createSessionWithSuccessBlock:errorBlock:]: 
  unrecognized selector sent to class 0x2a5798'

But I able to call using the deprecated way

[QBAuth createSessionWithDelegate:self context:testContext];

which I have handled with

-(void)completedWithResult:(Result *)result context:(void *)contextInfo { }

I quite sure that I followed iOS SDK Integration
The SDK version is 2.0.10

What wrong should I fix to work with new API?

Upvotes: 1

Views: 480

Answers (2)

SevenDays
SevenDays

Reputation: 3768

I'm using Quickblox and createSessionWithSuccessBlock works as expected.

Please try to setup Quickblox with CocoaPods and see if error happens again

http://quickblox.com/developers/IOS-how-to-connect-Quickblox-framework#CocoaPods

Upvotes: -1

rankAmateur
rankAmateur

Reputation: 2086

I was having exactly the same problem in a Swift project of mine. In my case I fixed it by adding -ObjC to Other Linker Flags in my build settings.

Upvotes: 3

Related Questions