Re: How do you receive a BOOL from a method returning BOOL
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: Shaun Wexler <email@hidden>
- Date: Sat, 18 Dec 2004 10:37:47 -0800
On Dec 18, 2004, at 10:22 AM, Evan Schoenberg wrote:
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);
NSLog(@"res: %@", res ? @"YES" : @"NO");
--
Shaun Wexler
MacFOH
http://www.macfoh.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