main_dict = [[NSDictionary alloc] init];
NSMutableArray *insert = [[NSMutableArray alloc] init];
[insert addObject:main_event];
NSString *count = [NSString stringWithFormat:@"%i",total_count];
[main_dict setValue:insert forKey:count];
I initialized the NSDictionary, main_dict and the NSMustableArray, insert. Then I added the main_event to the insert array. Finally added that array into dictionary with the key value.
I got SIG_ABRT signal when I stepped into the [main_dict setValue:insert forKey:count];
What’s wrong? I have all the elements initialized and have values, but still SIG_ABRT.
You need to change the data type of
main_dictto mutable type.NSDictionaryis an immutable type and you can not edit it. So change it asmain_dict = [[NSMutableDictionary alloc] init];