Objective C Segmentation Fault when using "NO" value in NSDictionary
Why do I g开发者_如何学JAVAet a Segmentation Fault when using a NO value in an NSDictionary?
You can only put instances of objects in a dictionary, set or array. Primitive types are not allowed, hence the segmentation fault.
Use a NSNumber instead:
[ dict setObject: [ NSNumber numberWithBool: yourBool ] forKey: @"..." ];
精彩评论