Howdy fellow programmers!
I've got an app on the iPhone that integrates with Apple's Address Book, but I'm wondering if there's a way to save/load the ABRecordRef's to/from disk. I'm currently doing the following:
Since CFArrays and NSArrays are toll-free bridged, the array conversion isn't an issue. I'm getting this error when writing to disk though, which leads me to believe there's an issue serializing the individual ABRecordRef's inside:
From reading that error message, does that sound like it's the issue? It's the only CFType-ish thing that I'm encoding, so I can't think of anything else that might be causing the problem.
If it is the problem, what other way should I be using to save those record types?
I've got an app on the iPhone that integrates with Apple's Address Book, but I'm wondering if there's a way to save/load the ABRecordRef's to/from disk. I'm currently doing the following:
Code:
# For the initWithCoder:
self.people = (CFMutableArrayRef)([[NSMutableArray alloc] initWithArray:[coder decodeObjectForKey:@"AssignmentPeople"]]);
#For the encodeWithCoder
NSArray *arrayToSave = (NSArray *)self.people;
[coder encodeObject:arrayToSave forKey:@"AssignmentPeople"];
Since CFArrays and NSArrays are toll-free bridged, the array conversion isn't an issue. I'm getting this error when writing to disk though, which leads me to believe there's an issue serializing the individual ABRecordRef's inside:
Code:
2008-06-29 22:07:30.863 iProcrastinate Mobile[2265:20b] *** -[NSCFType encodeWithCoder:]: unrecognized selector sent to instance 0x1a9930
2008-06-29 22:07:30.870 iProcrastinate Mobile[2265:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFType encodeWithCoder:]: unrecognized selector sent to instance 0x1a9930'
From reading that error message, does that sound like it's the issue? It's the only CFType-ish thing that I'm encoding, so I can't think of anything else that might be causing the problem.
If it is the problem, what other way should I be using to save those record types?