0

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.

How may I solve that please?

1
  • 2
    What kind of objects does your array contain? Can you confirm that all objects implement the NSCoding protocol? Commented Feb 27, 2010 at 20:15

1 Answer 1

1

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 >).

Sign up to request clarification or add additional context in comments.

5 Comments

That doesn't help us help you. :-) Post your code and describe how it's not working.
Sorry, I forgot. I got these error: 2010-02-28 22:22:18.145 My app[53732:a0f] -[content encodeWithCoder:]: unrecognized selector sent to instance 0x100189740 2010-02-28 22:22:18.146 My app[53732:a0f] -[content encodeWithCoder:]: unrecognized selector sent to instance 0x100189740
Might be a stupid question, but have you actually implemented the encodeWithCoder: method for the objects that are in the array?
All this back-and-forth questioning would be completely unnecessary if you'd post the relevant code.
I just noticed that it does not happen with any other array. The problem is the one being controlled by the array controller.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.