Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

trocks

macrumors newbie
Original poster
Aug 29, 2014
4
0
Hello,

I've built an iPhone app where there is a list of users that loads from the server (I'm using backend Quickblox) and there's an action that helps create a chat room. This action connects correctly in Xcode but when I run the app, it crashes and this error appears:

libc++abi.dylib: terminating with uncaught exception of type NSException

However, when I located the problem connection when the app isn't running it shows up as fine. It only shows an error when I run the app, and when I press on that connection within the app it crashes.

I hope I'm making sense, I'm a bit of a novice and this problem is frustrating me because no matter how many times I check, the connection appears to be fine. It only shows up "This event connection is of an unknown type" when I run the app.
 

trocks

macrumors newbie
Original poster
Aug 29, 2014
4
0
Code:
2014-08-30 00:27:47.791 GT[38749:1403] -[EndpointsAPIStorage retrieveEndpoints] -> urlRequest: <NSMutableURLRequest: 0xc497890> { URL: https://api.quickblox.com/account_settings.json }
2014-08-30 00:27:48.192 GT[38749:1403] -[EndpointsAPIStorage retrieveEndpoints] -> error in json parser: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (No value.) UserInfo=0xd14d070 {NSDebugDescription=No value.}
2014-08-30 00:27:48.202 GT[38749:400b] *** Terminating app due to uncaught exception 'BaseServiceException', reason: 'You have missed the authorization call.
Please insert following code inside your application 
[QBAuth createSessionWithDelegate:self];
Before any other code, that uses our service, but after setup credentials. Thank you.'
*** First throw call stack:
(
	0   CoreFoundation                      0x03f865e4 __exceptionPreprocess + 180
	1   libobjc.A.dylib                     0x0374a8b6 objc_exception_throw + 44
	2   GT                          0x0017ac34 +[QBBaseModule sharedModule] + 228
	3   GT                          0x00174422 -[QBQuery setHeaders:] + 466
	4   GT                          0x00174114 -[QBQuery setupRequest:] + 164
	5   GT                          0x00173dff -[QBQuery performInBgAsyncWithDelegate:] + 511
	6   Foundation                          0x01ce3597 -[NSThread main] + 76
	7   Foundation                          0x01ce34f6 __NSThread__main__ + 1275
	8   libsystem_c.dylib                   0x03ce55b7 _pthread_start + 344
	9   libsystem_c.dylib                   0x03ccfdce thread_start + 34
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

My only issue is that after inserting the code, it asked for the app key that leads back to my developer's console, which I already put in the app delegate.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Just to explain a bit more about the runtime exception. This text:

*** Terminating app due to uncaught exception 'BaseServiceException', reason: 'You have missed the authorization call.
Please insert following code inside your application
[QBAuth createSessionWithDelegate:self];
Before any other code, that uses our service, but after setup credentials. Thank you.'

comes from an exception thrown inside the QB code. The code inside QB has checked that it's been setup correctly. It determined that it wasn't setup correctly. And it threw an exception to tell you the problem. It explicitly tells you how to fix the problem in the text that comes after 'reason:'

You can thank the programmers for putting this exception in there to let you know what went wrong.
 

trocks

macrumors newbie
Original poster
Aug 29, 2014
4
0
Looks like you need to do a bit more setup with Quickblox. I've never used Quickblox so I am not sure what to tell you, try some google searching of Quickblox' website.

Did you do all of this?
http://quickblox.com/developers/IOS-how-to-connect-Quickblox-framework

Hello,

Thanks for your help. I actually fixed the problem by going through the code and making the request right before I entered the rest of the code :).

----------

Just to explain a bit more about the runtime exception. This text:



comes from an exception thrown inside the QB code. The code inside QB has checked that it's been setup correctly. It determined that it wasn't setup correctly. And it threw an exception to tell you the problem. It explicitly tells you how to fix the problem in the text that comes after 'reason:'

You can thank the programmers for putting this exception in there to let you know what went wrong.

Yeah, I figured out the problem and fixed it because of that. Thanks for the explanation.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.