Re: Help with detecting invalid object when in if() test....
Re: Help with detecting invalid object when in if() test....
- Subject: Re: Help with detecting invalid object when in if() test....
- From: "Alastair J.Houghton" <email@hidden>
- Date: Sat, 16 Aug 2003 11:15:54 +0100
On Friday, August 15, 2003, at 06:32 pm, Steven M.Palm wrote:
On Friday, August 15, 2003, at 11:56 AM, Alastair J.Houghton wrote:
The problem is that your -mySig method isn't returning a valid
pointer to an object.
Let me revise that :-) I just looked at your message again, and it
isn't returning a bad pointer, it's returning an NSNull. Try
sig == [NSNull null]
(NSNull is a singleton---there is only a single instance---so you
should be able to compare the pointers.)
In fact, if I were you, I'd write
!sig || sig == [NSNull null]
because that way if it returns nil in the future your code will still
work. It seems odd to me that there isn't a function or macro that
does exactly this, but I can't find one.
Kind regards,
Alastair.
_______________________________________________
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.