Re: Newbie question: setting a NSNumber
Re: Newbie question: setting a NSNumber
- Subject: Re: Newbie question: setting a NSNumber
- From: David Sinclair <email@hidden>
- Date: Tue, 21 May 2002 13:54:46 -0700
At 13:45 -0700 2002-05-21, email@hidden wrote:
At 1:12 PM -0700 5/21/02, David Sinclair wrote:
|- (void) setBlah:(NSNumber *)value
|{
| [blah autorelease];
| blah = [value copy];
|}
|
|or
|
|- (void)setBlah:(NSNumber *)value
|{
| [value retain];
| [blah release];
| blah = value;
|}
[...]
Andy Lee wrote:
|Is "blah" initialized in your class's init method? If not, its value
|is not predictable.
Yes, blah is set as follows in the init method:
blah = [NSNumber numberWithDouble:40.0];
To the original poster: do you know that "setBlah:" is in fact the
culprit? If you simply comment out the code in setBlah: (so that it
is effectively
- (void) setBlah:(NSNumber *)value
{
}
), does the problem go away? The code does look OK, which is why I
wonder if the problem is where you think it is.
Yes, if I comment out the method body, or the method call itself, it
works fine.
--
David Sinclair - email@hidden
President, Dejal Systems, LLC
http://www.dejal.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.