• 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: "Steven M.Palm" <email@hidden>
  • Date: Fri, 15 Aug 2003 12:32:05 -0500

On Friday, August 15, 2003, at 11:56 AM, Alastair J.Houghton wrote:
On Friday, August 15, 2003, at 03:19 pm, Steven M.Palm wrote:
I know this sounds very basic, but I can't seem to get it right.

I have the following:

sig = [bEnd mySig];

And this doesn't always return a valid object... If I try to use the name method on sig, [sig name], it will generate an exception if sig is not a valid object, -[NSNull name]: selector not recognized.

Okay, I thought I would just put the code that acts on sig inside an if statement...

if (sig) { blah }

The problem is that your -mySig method isn't returning a valid pointer to an object.

Well, I guess I can't check this then... It's not my method, I'm working on a bundle for Mail.App, so I can't change what gets returned. Is there any way to determine if a value returned is proper or not?

Interesting, if I do something like:

NSLog(@"sig = %d, %@", val);

I get this, consistently, when it's bad.

sig = -1609366696, null

Yet a comparison to NULL, nil, or even [NSNull null] doesn't match. Hmmm....

-. ----. -.-- - -.--
Steve Palm - email@hidden
-. ----. -.-- - -.--
_______________________________________________
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.

  • Follow-Ups:
    • Re: Help with detecting invalid object when in if() test....
      • From: "Alastair J.Houghton" <email@hidden>
References: 
 >Re: Help with detecting invalid object when in if() test.... (From: "Alastair J.Houghton" <email@hidden>)

  • Prev by Date: Re: Dynamic menu building
  • Next by Date: Re: Help with detecting invalid object when in if() test....
  • 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