NSUserDefaults won't accept custom classes. So h开发者_如何学编程ow can these objects be stored and retrieved?
You have to make your class implement the NSCoding protocol before it can be serialized in the user defaults.
See: Archives and Serializations Programing Guide
精彩评论