• 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: changing NSNumber from within another function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing NSNumber from within another function


  • Subject: Re: changing NSNumber from within another function
  • From: Nick Zitzmann <email@hidden>
  • Date: Fri, 28 Mar 2008 09:59:34 -0600


On Mar 28, 2008, at 9:33 AM, Nick Rogers wrote:
- (void)function2:(NSNumber *)value
{
	value = [NSNumber numberWithBool:YES];
}	

How to change a parameter's value this way from inside a second method.


The same way you'd do it in C: (warning - written in Mail, untested, use at your own risk, but it should work)

- (void)function2:(NSNumber **)value
{
	if (value != NULL)
		*value = [NSNumber numberWithBool:YES];
}

Nick Zitzmann
<http://www.chronosnet.com/>




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >changing NSNumber from within another function (From: Nick Rogers <email@hidden>)

  • Prev by Date: Re: Daemon vs. Keychain
  • Next by Date: Re: changing NSNumber from within another function
  • Previous by thread: changing NSNumber from within another function
  • Next by thread: Re: changing NSNumber from within another function
  • Index(es):
    • Date
    • Thread