Re: Does retain not work on ids?
Re: Does retain not work on ids?
- Subject: Re: Does retain not work on ids?
- From: Ken Tozier <email@hidden>
- Date: Mon, 23 May 2005 22:50:34 -0400
On May 23, 2005, at 10:37 PM, Andy Lee wrote:
On May 23, 2005, at 10:27 PM, Ken Tozier wrote:
- (id) data
{
return [self objectForKey: @"data"];
}
[...]
// get retainable properties
result.data = [inDescription data];
What steps have you taken to confirm that [inDescription data] is
returning a non-nil value?
It's defined in a plist file, I read it into an NSDictionary and pass
that dictionary to the UILayoutView factory method in my awakeFromNib
like so:
NSDictionary *props = [NSDictionary
dictionaryWithContentsOfFile: <file path here>];
UILayoutView *temp = [UILayoutView objectWithDescription: props
superview: graphicView];
[graphicView addSubview: temp];
Have you set a breakpoint in the debugger?
Yes. It always shows a valid properties.data object inside init and
nil inside drawRect. In between, I don't explicitly do anything. All
calls to the drawRect method are initiated by the windowing system.
Have you inserted an NSLog?
Yes. In the init method, NSLogs show the properties.data object
exists and is non-nil. by the time it gets to drawRect, it's nil.
Have you examined the code that puts the data in the dictionary in
the first place, to make sure it isn't misspelling the key?
Yes. This all shows up in the init method and at that point
everything is kosher.
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