0

I'm trying to check that a value can be safely added to a plist. I've read Apple's documentation on plists.

I'm storing values in an NSMutableDictionary and then serializing them using NSPropertyListSerialization. If I want to check that a value added to my dictionary will be serializable, can I use [value isKindOfClass:[NSNumber class]] or do I need to check against the core foundation types backing it?

4

1 回答 1

3

That's safe enough. But did you know that you can write plists by simply doing:

[dict writeToFile:path atomically:YES];

As long as you only have plist compatible objects in the dictionary of course.

于 2012-11-29T18:07:10.453 回答