0

I'm attempting to save an object that has an NSMutableArray of nested objects. I want to use the NSCoding Protocol to save the file under the documents directory. Do I need to encode every object (including the nested ones) or just the super class itself? Right now I'm only encoding the super class' objects.

To better illustrate what my object hierarchy looks like:

Main Object
  -NSString
  -int
  -NSMutableArray
    -int
    -double
    -char
Stuartsoft
  • 1,000
  • 1
  • 8
  • 20

1 Answers1

0

Yes. Not implementing the NSCoding Protocol within the subclass throws an exception

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Set encodeWithCoder:]: unrecognized selector sent to instance 0x6891470'

"Set" was the sub class nested in the main class I was trying to save.

Stuartsoft
  • 1,000
  • 1
  • 8
  • 20