Getting crash in app store build and the crash log says the below information. Anybody can help on this? What does the crashlog says?
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 9
Last Exception Backtrace:
0 CoreFoundation 0x196fae2c8 __exceptionPreprocess + 164 (NSException.m:202)
1 libobjc.A.dylib 0x190307a68 objc_exception_throw + 60 (objc-exception.mm:356)
2 Foundation 0x1914475b8 +[NSJSONSerialization JSONObjectWithData:options:error:] + 184 (NSJSONSerialization.m:0)
3 Checkers 0x101eb8070 __36-[PaytronixAppDelegate needsUpdate:]_block_invoke + 92 (PaytronixAppDelegate.m:647)
4 CFNetwork 0x19814a180 __40-[__NSURLSessionLocal taskForClassInfo:]_block_invoke + 484 (LocalSession.mm:718)
5 CFNetwork 0x19815a0d8 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke_2 + 164 (LocalSessionTask.mm:544)
6 libdispatch.dylib 0x19e53b4b4 _dispatch_call_block_and_release + 32 (init.c:1518)
7 libdispatch.dylib 0x19e53cfdc _dispatch_client_callout + 20 (object.m:560)
8 libdispatch.dylib 0x19e544694 _dispatch_lane_serial_drain + 672 (inline_internal.h:2632)
9 libdispatch.dylib 0x19e545214 _dispatch_lane_invoke + 436 (queue.c:3940)
10 libdispatch.dylib 0x19e54fe10 _dispatch_workloop_worker_thread + 652 (queue.c:6846)
11 libsystem_pthread.dylib 0x1e4809df8 _pthread_wqthread + 288 (pthread.c:2618)
12 libsystem_pthread.dylib 0x1e4809b98 start_wqthread + 8
My code snippet which is crashing while doing json parsing
-(void)needsUpdate:(void (^)(NSDictionary * dictionary))completionHandler{
NSDictionary* infoDictionary = [[NSBundle mainBundle] infoDictionary];
NSString* appID = infoDictionary[@"CFBundleIdentifier"];
NSURL* url = [NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/lookup?bundleId=%@", appID]];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request
completionHandler:
^(NSData *data, NSURLResponse *response, NSError *error) {
NSDictionary* lookup = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
if (completionHandler) {
completionHandler(lookup);
}
}];
[task resume];
}