NSEncoder question
NSEncoder question
- Subject: NSEncoder question
- From: Jeff LaMarche <email@hidden>
- Date: Sat, 6 Oct 2001 00:18:29 -0700
Hello.
Well, I'm back to this list after a couple of months absence. I had to
unsubscribe my work e-mail from the list because of the increasing
volume; I've also been busy with other things: surprisingly, a new
house, new twin babies, a new, longer commute, and a new position at
work combine to leave me very little time for learning Cocoa.
But, by reducing my sleep from not-enough to not-even-close-to-enough,
I'm managed to find some time to start really getting into Cocoa. I'm
finding I like it. Heck, I've actually written some objects that do real
things -- albeit not very interesting or complex things.
Now, I'm trying to flesh out these objects by conforming to appropriate
protocols like NSCopying and NSCoding, and I've got a real quick, real
easy question about using NSCoding:
In - (id)initWithCoder:(NSCoder *)coder, do you need to send an init
message to Super if you're subclassing NSObject?
I know if your superclass conforms to NSCoding, then you must send super
an initWithCoder message to super, but it's not clear if you need to
send a plain old init message to super before decoding if super doesn't
conform to NSCopying. It seems like NSObject would need to receive some
init message in order to initialize variables necessary for proper
functioning of Cocoa, but in the example source code I've found, this
does not seem to be done.
Thanks in advance for the help.
Jeff
P.S. Prepare yourself - the next time I ask a question it won't be
nearly so easy: The next thing on my Cocoa to-do list is to learn to use
NSThread and DO so as to not bring my app's UI to a screeching halt
while my objects do their thing.