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

changing NSNumber from within another function


  • Subject: changing NSNumber from within another function
  • From: Nick Rogers <email@hidden>
  • Date: Fri, 28 Mar 2008 21:03:23 +0530

Hi,
I have:

- (void)function1
{
	NSNumber *moveUp = [NSNumber numberWithBool:NO];

	[self function2:moveUp];

//value of moveUp after returning from function2 is the previous one and not the value thats changed in function2
// so the value [moveUp boolValue] here is still 'NO'


}

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

How to change a parameter's value this way from inside a second method.
Will taking moveUp as global, is the solution. haven't tried that yet.

Please help

Thanks,
Nick

_______________________________________________

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


  • Follow-Ups:
    • Re: changing NSNumber from within another function
      • From: Alastair Houghton <email@hidden>
    • Re: changing NSNumber from within another function
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: NSToolbar doesn't add default items issue on 10.5.2
  • Next by Date: Re: Daemon vs. Keychain
  • Previous by thread: Re: Daemon vs. Keychain
  • Next by thread: Re: changing NSNumber from within another function
  • Index(es):
    • Date
    • Thread