• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help with detecting invalid object when in if() test....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Help with detecting invalid object when in if() test.... (From: "Steven M.Palm" <email@hidden>)

  • Prev by Date: Override a Finder command
  • Next by Date: Authorized operations
  • Previous by thread: Re: Help with detecting invalid object when in if() test....
  • Next by thread: Re: Help with detecting invalid object when in if() test....
  • Index(es):
    • Date
    • Thread