0

I'm having some troubles trying to save a singleton object to the iPhone disk.

The object is a collection of 2 arrays, which contain the faved posts and faced jobs. Basically --> Favorites = arrayOfFavedPosts + arrayOfFavedJobs

Now I am trying to save the Favorites object, so that the once faved posts or jobs can be read from the disk.

my Faves.m file.

Error:

2012-04-26 14:56:56.957 FirstDesign_test2[666:10403] -[Post encodeWithCoder:]: unrecognized selector sent to instance 0x6c74a80

This error fires up when I call the saveToDisk method when I add a new object to one of the arrays...

Some help would be really appreciated!

Thanks in Advance

Mathew Thompson
  • 55,877
  • 15
  • 127
  • 148

1 Answers1

2

You need to adopt and implement the NSCoding protocol on your Post class (and presumably on your Job class).

NSCoding Protocol Reference
Archives and Serializations Programming Guide: Encoding and Decoding Objects

rob mayoff
  • 375,296
  • 67
  • 796
  • 848