[NSKeyedArchiver archivedDataWithRootObject:array];

I need to archive a NSMutableArray which is being controlled by an ArrayController. I tried this:

[NSKeyedArchiver archivedDataWithRootObject:array]; 

But I got this error:

*** -[NSKeyedArchiver dealloc]: warning: NSKeyedArchiver deallocated  without having had -finishEncoding  called on it.

 

 

======================================

The root object of the graph you're archiving and anything referenced/contained by it must conform to < NSCoding > protocol. See Encoding and Decoding Objects for code examples for making your classes compliant (don't forget to "adopt" the protocol in your objects' interface declaration: @interface MyClass : NSObject < NSCoding >).

 

http://stackoverflow.com/questions/2348774/archive-a-nsmutablearray

 

 

你可能感兴趣的:(object,Graph,interface,encoding,archive)