dealloc event
dealloc event
- Subject: dealloc event
- From: "Theodore H. Smith" <email@hidden>
- Date: Fri, 20 May 2005 13:30:29 +0100
Sorry this is a very basic question, but I didn't see it answered in
the Cocoa docs.
If I have some object defined with object fields, must I release them
on my object's dealloc event, or does this happen automatically?
@interface MyDocument : NSDocument
{
NSData* MyData;
}
- (void) dealloc;
@end
Let's say that I've previously retained MyData.
- (id)init {
MyData = [[self GetSomeData] retain];
...
}
So should I do this?
- (void) dealloc {
[MyData release];
}
or this:
- (void) dealloc {
;
}
In C++ you wouldn't have to release anything for objects in the struct,
but I have a feeling I need to call release in the dealloc event in
ObjC.
--
elfdata.com/plugin/ Industrial strength string processing, made easy.
"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden