ios - Quickblox APIs in swift crashes with unrecognized selector -


i have issue quickblox when trying integrate code in swift.

below code ruuning in objective-c without error

appdellgate.m file

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {     [qbsettings setapplicationid:kapplicationid];     [qbsettings setauthkey:kauthkey];     [qbsettings setauthsecret:kauthsecret];     [qbsettings setaccountkey:kacconuntkey];      [[geodatamanager instance] fetchlatestcheckins];          return yes; } 

geodatamanager.m file

@implementation geodatamanager  + (instancetype)instance {     static geodatamanager *instance = nil;     static dispatch_once_t oncetoken;      dispatch_once(&oncetoken, ^{         instance = [self new];     });      return instance; }  - (void)fetchlatestcheckins {     qblgeodatafilter* filter = [qblgeodatafilter new];     filter.lastonly = yes;     filter.sortby = geodatasortbykindcreatedat;      qbgeneralresponsepage *page = [qbgeneralresponsepage responsepagewithcurrentpage:1 perpage:70];      [qbrequest geodatawithfilter:filter                            page:page                    successblock:^(qbresponse *response, nsarray *objects, qbgeneralresponsepage *page) {                         [[datamanager shareddatamanager] savecheckins:objects];                     } errorblock:^(qbresponse *response) {                          nslog(@"error = %@", response.error);                      }]; } 

but when trying call same method swift base project below code

swift appdelegate.

func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool {          // set quickblox credentials (you must create application in admin.quickblox.com).         qbsettings.setapplicationid(kqbapplicationid)         qbsettings.setauthkey(kqbauthkey)         qbsettings.setauthsecret(kqbauthsecret)         qbsettings.setaccountkey(kqbaccountkey)           geodatamanager .instance().fetchlatestcheckins()           return true     } 

i getting uncaught exception 'nsinvalidargumentexception', reason: '+[qbrequest geodatawithfilter:page:successblock:errorblock:]: unrecognized selector sent class.

i have added geodatamanager & created bridging header same.

could 1 please assist me doing wrong? idea or suggestion great.

seems don't have needed linker flags

  1. full guide http://quickblox.com/developers/ios-how-to-connect-quickblox-framework
  2. please take @ step 7:

add -lxml2, -objc, -lstdc++ flags other linker flags section in project settings


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -