Does retain not work on ids?
Does retain not work on ids?
- Subject: Does retain not work on ids?
- From: Ken Tozier <email@hidden>
- Date: Mon, 23 May 2005 21:40:07 -0400
I have a struct in which one field (type = id) serves as a generic
"data" object. In my initialization method, i've tried several
different ways to retain the field, but when a later method goes to
access it, it's always nil. In the past, I've not noticed any
difference between sending a message to the id of objects rather than
an "official" object.
for example, in a while loop, there's no problem calling the id's
method:
NSArray *dict = [NSArray arrayWithObjects:
@"when",
@"pigs",
@"fly",
nil];
NSEnumerator *enumerator = [dict objectEnumerator];
NSString *tempString;
id tempObj;
while (tempObj = [enumerator NextObject])
{
tempString = [obj stringByAppendingString: @" uh"];
}
Is "retain" an exception to this rule?
I've also put in NSLogs in the dealloc method for my class to see if
i could catch in the act of deallocating bit it never appears in the
run log.
Thanks
Ken
_______________________________________________
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