1

I'm attempting to use this library https://github.com/updatezen/Parse-NSCoding/ in my project, but when I import the .h/.m files into my project it still throws a warning when I try to do cache my PFObjects [cache setObject:myPFObject forKey:@"PFObjectID"]; saying

"Sending 'PFObject *const_strong' to parameter of incompatible type 'id <\NSCoding>'"

Has anybody else tried to use this library with any success

Apollo
  • 8,874
  • 32
  • 104
  • 192

1 Answers1

1

I'm the author of this library. It was intended to be used with PFObject subclasses. It looks like the cache you're using is expecting a type that explicitly implements NSCoding. Try subclassing PFObject in a new class and adding the NSCoding protocol declaration to your .h file.

https://parse.com/docs/ios_guide#subclasses/iOS

martin
  • 132
  • 1
  • 4
  • The error you are getting is only a compiler warning. Your PFObject will implement NSCoding at runtime. Here is a quick proof: `PFObject* parseObject = [[PFObject alloc] initWithClassName:@"Test"]; assert([parseObject respondsToSelector:@selector(initWithCoder:)]); ` – martin Feb 19 '14 at 18:25
  • would you mind taking a look at a new question of mine here: http://stackoverflow.com/questions/23119739/saving-pfobject-nscoding, thanks so much! – Apollo Apr 16 '14 at 20:43