i have built and run an iOS app and it crashed as soon as it got launched with this error in AppDelegate.swift:
Thread 1: Exception: "*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
Following is the screenshot of code for reference.
i am not able to identify that error is present in which part of code so that i can debug it further by applying breakpoint.Need help in fixing this.
adding segment of code where objects are inserted into the array for reference.
+ (NSArray *)relevantURLSchemes { NSMutableArray *result = [[NSMutableArray alloc] init]; for (NSBundle *bundle in [[self class] relevantBundles]) { NSArray *urlTypes = [bundle objectForInfoDictionaryKey:@"CFBundleURLTypes"]; for (NSDictionary *urlType in urlTypes) { [result addObjectsFromArray:urlType[@"CFBundleURLSchemes"]]; } } return result;}