Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone app crash with [NSObject(NSObject) doesNotRecognizeSelector:]
    primarykey
    data
    text
    <p>Here is the crash report not sure why. I use AFHTTPRequestOperation setCompletionBlockWithSuccess:failure: to make a call. in the completion block I get the results and pass it to a category class on my data model to insert into core data tables.</p> <p>below is the crash log..</p> <p>Last Exception Backtrace:</p> <pre><code>0 CoreFoundation 0x2fed7f4e __exceptionPreprocess + 126 1 libobjc.A.dylib 0x3a2b06aa objc_exception_throw + 34 2 CoreFoundation 0x2fedb8e2 -[NSObject(NSObject) doesNotRecognizeSelector:] + 198 3 CoreFoundation 0x2feda1ce ___forwarding___ + 702 4 CoreFoundation 0x2fe29594 __forwarding_prep_0___ + 20 5 &lt;myappname&gt; 0x000bbfe8 +[BTRooms(Data) createNewRoom:withNode:] (BTRooms+Data.m:32) 6 &lt;myappname&gt; 0x000b034e __28-[BTNet createRoom:friends:]_block_invoke (BTNet.m:551) 7 &lt;myappname&gt; 0x0008fd10 __64-[AFHTTPRequestOperation setCompletionBlockWithSuccess:failure:]_block_invoke139 (AFHTTPRequestOperation.m:279) 8 libdispatch.dylib 0x3a793d76 _dispatch_call_block_and_release + 6 9 libdispatch.dylib 0x3a793d62 _dispatch_client_callout + 18 10 libdispatch.dylib 0x3a79a7bc _dispatch_main_queue_callback_4CF$VARIANT$mp + 264 11 CoreFoundation 0x2fea281c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4 12 CoreFoundation 0x2fea10f0 __CFRunLoopRun + 1296 13 CoreFoundation 0x2fe0bce2 CFRunLoopRunSpecific + 518 14 CoreFoundation 0x2fe0bac6 CFRunLoopRunInMode + 102 15 GraphicsServices 0x34b2c27e GSEventRunModal + 134 16 UIKit 0x326ada3c UIApplicationMain + 1132 17 &lt;myappname&gt; 0x0005e280 main (main.m:16) 18 libdyld.dylib 0x3a7b8ab2 tlv_initializer + 2 </code></pre> <p>Crashed Thread</p> <pre><code>0 libsystem_kernel.dylib 0x3a86f1fc __pthread_kill + 8 1 libsystem_pthread.dylib 0x3a8d8a2e pthread_kill + 54 2 libsystem_c.dylib 0x3a81fff8 abort + 72 3 libc++abi.dylib 0x39b4ecd2 abort_message + 70 4 libc++abi.dylib 0x39b676e0 default_terminate_handler() + 248 5 libobjc.A.dylib 0x3a2b091e _objc_terminate() + 190 6 libc++abi.dylib 0x39b651c4 std::__terminate(void (*)()) + 76 7 libc++abi.dylib 0x39b64a18 __cxa_throw + 112 8 libobjc.A.dylib 0x3a2b077e objc_exception_throw + 246 9 CoreFoundation 0x2fedb8e2 -[NSObject(NSObject) doesNotRecognizeSelector:] + 198 10 CoreFoundation 0x2feda1ce ___forwarding___ + 702 11 CoreFoundation 0x2fe29594 __forwarding_prep_0___ + 20 12 &lt;myappname&gt; 0x000bbfea +[BTRooms(Data) createNewRoom:withNode:] (BTRooms+Data.m:32) 13 &lt;myappname&gt; 0x000b0350 __28-[BTNet createRoom:friends:]_block_invoke (BTNet.m:551) 14 &lt;myappname&gt; 0x0008fd12 __64-[AFHTTPRequestOperation setCompletionBlockWithSuccess:failure:]_block_invoke139 (AFHTTPRequestOperation.m:279) 15 libdispatch.dylib 0x3a793d78 _dispatch_call_block_and_release + 8 16 libdispatch.dylib 0x3a793d64 _dispatch_client_callout + 20 17 libdispatch.dylib 0x3a79a7bc _dispatch_main_queue_callback_4CF$VARIANT$mp + 264 18 CoreFoundation 0x2fea281c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4 19 CoreFoundation 0x2fea10f0 __CFRunLoopRun + 1296 20 CoreFoundation 0x2fe0bce2 CFRunLoopRunSpecific + 518 21 CoreFoundation 0x2fe0bac6 CFRunLoopRunInMode + 102 22 GraphicsServices 0x34b2c27e GSEventRunModal + 134 23 UIKit 0x326ada3c UIApplicationMain + 1132 24 &lt;myappname&gt; 0x0005e280 main (main.m:16) 25 libdyld.dylib 0x3a7b8ab4 start + 0 </code></pre> <p>Please give me some insights on the crash log. I have been on this for several hours now.</p> <p>Here is my code..</p> <pre><code>MyClient* client = [MyClient sharedClient]; [client setParameterEncoding:AFJSONParameterEncoding]; NSMutableURLRequest* request = [client requestWithMethod:@"POST" path:@"/JoinRoom" parameters:data]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; [client registerHTTPOperationClass:[AFHTTPRequestOperation class]]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { // Print the response body in text //NSString* responseText = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]; NSError* error3; NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseObject //1 options:0 error:&amp;error3]; NSString* status = [json objectForKey:@"status"]; if ([status isEqualToString:kBTOK]){ // OK NSDictionary* room = [json objectForKey:@"data"]; BTRooms* newRoom = [BTRooms createNewRoom:room withNode:@""]; } else{ // Do something else } } failure:^(AFHTTPRequestOperation *operation, NSError *error) { // Do something else }]; [[[MyClient sharedClient] operationQueue] addOperation:operation]; </code></pre> <p>And [BTRooms createNewRoom:room withNode:@""] looks like this.. </p> <pre><code>+ (BTRooms*) createNewRoom:(NSDictionary *)roomDic withNode: (NSString*) node{ NSString* roomId = [roomDic objectForKey:@"roomid"]; //more code here } </code></pre> <p>It doesn't crash when I connect and debug with xCode. It crashes randomly when the app is in the background for a while and I run it in the device. The one that made the remote call is one of my tabbar controller viewcontroller.</p> <p><strong>NEW UPDATE</strong>:</p> <p>Figured it out! Sorry for the misleading question. nothing to do with iOS. it was a bug from the server side (app engine issue). I will post that in a separate question.</p> <pre><code>[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { NSError* error3; NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseObject //1 options:0 error:&amp;error3]; NSString* status = [json objectForKey:@"status"]; if ([status isEqualToString:kBTOK]){ // OK NSDictionary* room = [json objectForKey:@"data"]; // room is null here!! } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload