• 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: How do you receive a BOOL from a method returning BOOL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you receive a BOOL from a method returning BOOL


  • Subject: Re: How do you receive a BOOL from a method returning BOOL
  • From: Evan Schoenberg <email@hidden>
  • Date: Sat, 18 Dec 2004 12:22:54 -0600


On Dec 18, 2004, at 9:02 AM, BK [address used for mailing lists only] wrote:


BOOL res;
...
res = [res is10digitNANPA:[aString substringFromIndex:index]];
NSLog(@"res: %@", res);
return res;

and it shows me that res is NULL.

You need to read up on the printf-style formatters NSLog uses.

Here's a good cocoadevcentral article on it. Note the list of formatters about halfway down the page.
http://www.cocoadevcentral.com/articles/000007.php


One problem (of many potential problems) your code definitely has is that you can't print a BOOL value using the %@ formatter, which is reserved for ObjC objects. I'm amazed this line isn't crashing your program. The NSLog you want is:
NSLog(@"res: %i", res);


Hope that helps,
Evan
www.adiumx.com

_______________________________________________
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


  • Follow-Ups:
    • Re: How do you receive a BOOL from a method returning BOOL
      • From: Steven Kramer <email@hidden>
    • Re: How do you receive a BOOL from a method returning BOOL
      • From: Shaun Wexler <email@hidden>
References: 
 >How do you receive a BOOL from a method returning BOOL (From: "BK [address used for mailing lists only]" <email@hidden>)

  • Prev by Date: Key-value coding and dictionaries (was Re: Weird behavior in NSMutableDictionary)
  • Next by Date: Re: How do you receive a BOOL from a method returning BOOL
  • Previous by thread: Re: How do you receive a BOOL from a method returning BOOL
  • Next by thread: Re: How do you receive a BOOL from a method returning BOOL
  • Index(es):
    • Date
    • Thread