I am getting strange exception when calling the NSDictionary in the following example:
NSInteger userId = 1;
NSDictionary *postData = [NSDictionary dictionaryWithObjectsAndKeys:
@"3", @"a",
@"0", @"b",
userId, @"c",
nil];
Can someone see what’s the problem above?
NSDictionary, as most collections, just accepts real Obj-C objects (idtype), but you are passing aNSIntegerwhich is a normal C typedef.Try with
NSNumber userId = [NSNumber numberWithInt:1];