node ninja
node ninja

Reputation: 33036

How to store and retrieve a custom class

NSUserDefaults won't accept custom classes. So how can these objects be stored and retrieved?

Upvotes: 0

Views: 54

Answers (1)

TechZen
TechZen

Reputation: 64428

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

Upvotes: 3

Related Questions