I am trying to create a chat room in QuickBlox using my iOS app.
[[QBChat instance] createPrivateRoomWithName:@"My Room"];
- (void)createPrivateRoomWithName:(QBChatRoom*)room{
NSLog(@"Private room %@ was created", room.name);
// Add users to this room
NSNumber *anny = [NSNumber numberWithInt:300];
NSNumber *jim = [NSNumber numberWithInt:357];
NSArray *users = [NSArray arrayWithObjects:anny, jim, nil];
[[QBChat instance] addUsers:users toRoom:room];
}
but after using this code my application is crashing, below is the crash log.
2013-01-03 19:13:55.234 Chat.Points[11178:23d03] +[QBDDXMLElement elementWithName:xmlns:]: unrecognized selector sent to class 0x22f73c
2013-01-03 19:13:55.241 Chat.Points[11178:23d03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[QBDDXMLElement elementWithName:xmlns:]: unrecognized selector sent to class 0x22f73c'
*** First throw call stack:
(0x32fe012 0x29eae7e 0x33892ad 0x32edbbc 0x32ed94e 0x101e05 0x2da153f 0x2db3014 0x2da3418 0x2da32a6 0x2da4280 0x2da3fcb 0x990f7b24 0x990f96fe)
libc++abi.dylib: terminate called throwing an exception
You have to login to QuickBlox Chat before creating room.
The solution is:
1) you have to add -ObjC flag to Other Linker Flags
2) Add to SplashController.h chat delegate QBChatDelegate
3) Add to SplashController.m,
to if
at the top next lines:
4) Finally, add to the end
Just Add -ObjC flag in Other Linker Flags in your targets' settings. Hope it will solve your problem.