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

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


  • Follow-Ups:
    • Re: How do you receive a BOOL from a method returning BOOL
      • From: Evan Schoenberg <email@hidden>
    • Re: How do you receive a BOOL from a method returning BOOL
      • From: James Spencer <email@hidden>
    • Re: How do you receive a BOOL from a method returning BOOL
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: Weird behavior in NSMutableDictionary
  • Next by Date: How to draw and image and a Title in the same cell of a Menu item
  • Previous by thread: NSSearchField...Solution
  • Next by thread: Re: How do you receive a BOOL from a method returning BOOL
  • Index(es):
    • Date
    • Thread