Action not connecting correctly

Discussion in 'iOS Programming' started by trocks, Aug 29, 2014.

  1. trocks macrumors newbie

    Joined:
    Aug 29, 2014
    #1
    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.
     
  2. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #2
    I would post the actual code and the entire error from the console
     
  3. trocks thread starter macrumors newbie

    Joined:
    Aug 29, 2014
    #3
    How exactly do I do this? I see people take pictures and embed it into their posts.
     
  4. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #4
    Just copy the code and paste using the little # icon in the editor

    Code:
    like this
     
  5. trocks thread starter macrumors newbie

    Joined:
    Aug 29, 2014
    #5
    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.
     
  6. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #6
  7. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #7
    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.
     
  8. trocks thread starter macrumors newbie

    Joined:
    Aug 29, 2014
    #8
    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 :).

    ----------

    Yeah, I figured out the problem and fixed it because of that. Thanks for the explanation.
     

Share This Page