Tried to find the answer here and eventually found a clue on another site. Posting here in case anyone searches here and has the same problem.
NSDictionary *d = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"foo", YES, 42, nil]
forKeys:[NSArray arrayWithObjects:@"bar", @"baz", @"count", nil]];
This produces:
Program received signal: "EXC_BAD_ACCESS"
What is the cause of this?
YESand42are not object pointers. You’re trying to create an NSArray, which can only contain objects, and you’re passing in values that are not pointers to objects. You’ll crash for the same reason thatwill crash —
YESis not a valid object pointer.