NSUserDefaults存储数据的类型是有限制的!NSUserDefaults里面只能存储property list objects.具体的内容请看下面的链接.特别的,对于NSDictionary,NSUserDefaults只能存储key为NSString类型的,而不能存其他类型的,比如说key是NSNumber的. https://developer.apple.com/library/ios/#documentation/General/Conceptual/DevPedia-Coco