How do you receive a BOOL from a method returning BOOL
How do you receive a BOOL from a method returning BOOL
- Subject: How do you receive a BOOL from a method returning BOOL
- From: "BK [address used for mailing lists only]" <email@hidden>
- Date: Sun, 19 Dec 2004 00:02:24 +0900
I have written a few Objective-C methods which I call from AppleScript
Studio apps.
So far I have always returned either a literal like 'return YES;' or a
local variable 'return myLocalVar;' or the result of a method call
where I could use the class name as the receiver such as in
return [NSString someMethodReturningNSString];
but now I have run into a very silly problem trying to return the
result of a method call that returns a BOOL. It would seem trivial but
I can't seem to work out how to do this. My code looks like this ...
return [res is10digitNANPA:[aString substringFromIndex:index]];
but that doesn't work. I have alo tried this ...
BOOL res;
...
res = [res is10digitNANPA:[aString substringFromIndex:index]];
NSLog(@"res: %@", res);
return res;
and it shows me that res is NULL.
[BOOL someMethodReturningBOOL];
doesn't work because BOOL is not a a class.
I could do something like this ...
if (someMethodReturningBOOL)
return Yes;
else
return NO;
but that would seem a bit of a kludge.
so how do you properly return the result of a method that returns BOOL?
thanks in advance
rgds
bk
_______________________________________________
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