Frage

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?

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top