• 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: A quick one: Passing a reference/pointer to NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A quick one: Passing a reference/pointer to NSString


  • Subject: Re: A quick one: Passing a reference/pointer to NSString
  • From: Jeff Brown <email@hidden>
  • Date: Tue, 22 Jul 2008 18:49:12 -0700 (PDT)

Sorry - it should have been:

- (void) aMethod
{
   NSString* string1 = @"";
   NSString* string2 = @"";

   string1 = [self foo:string2];
}

- (NSString*) foo:(NSString*)aString
{
   NSString* stringA = @"Hi there";
   NSString* stringB = @"Everyone";
   aString = stringB;

   return stringA;
}

I need to get 2 strings back from foo. I can get foo to return one. I need to pass the other one in by reference. It seems that since I'm passing a pointer to an NSString as the argument, it should be fine but it's not.

By the way
How do you reply on this mailing list so that the reply remains part of the thread?




      Start at the new Yahoo!7 for a better online experience. www.yahoo7.com.au
_______________________________________________

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: A quick one: Passing a reference/pointer to NSString
      • From: Ken Thomases <email@hidden>
    • Re: A quick one: Passing a reference/pointer to NSString
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: A quick one: Passing a reference/pointer to NSString
  • Next by Date: Re: A quick one: Passing a reference/pointer to NSString
  • Previous by thread: Re: A quick one: Passing a reference/pointer to NSString
  • Next by thread: Re: A quick one: Passing a reference/pointer to NSString
  • Index(es):
    • Date
    • Thread