Question

I have an array of NSBezierPath objects that essentially represent all the strokes the user makes in my basic paint application. However, when trying to create an NSData object (plist containing the array) in dataOfType:error: the app gives me the error:

(property lists cannot contain objects of type 'CFType')

However, a breakpoint shows my array contains no CFTypes:

_myArray    __NSArrayM *    @"9 objects"    0x0000610000052300
[0]    NSBezierPath *   0x0000610000127300  0x0000610000127300
[1]    NSBezierPath *   0x0000618000126d60  0x0000618000126d60

…And so on. I suspect that there is some connection between CFTypes and NSBezierPaths, but I don't quite get it. How should I go about saving my array?

Was it helpful?

Solution

NSArray, NSDictionary, NSDate, NSData, NSString and NSNumber are the only objects that can be serialized in plists. Sorry can't help it's the storing of NSBezierPaths. You may want to read up more on the Nerd blog

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top