• 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: how to combine addObject with Object instantiation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to combine addObject with Object instantiation?


  • Subject: Re: how to combine addObject with Object instantiation?
  • From: ANE <email@hidden>
  • Date: Mon, 04 May 2009 22:13:49 +0200

Sorry. But this is the wrong list for this question. Use cocoa-dev instead...

[myArray addObject:[NSString stringWithFormat:@"%@",@"test"]];

or (better)

[myArray addObject: @"test"];

or (more general)

[myArray addObject:[AClass initWithXYZ: blabla]];



Am 03.05.2009 um 21:53 schrieb Sandy Santra:

After

	NSMutableArray *myArray = [NSMutableArray array];

Is there any way to combine these two lines:

	NSString *myName = @"Joe";
	[myArray addObject:myName];

into one line?

I keep thinking there's a way to use

	[myArray addObject:[instantiation of some object]];

to add all types of objects to a mutable array, but can't seem to figure out how to combine statements.

Thanks!




--Sandy Santra




_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

-- Dr. Volker Thieme Rochlitzstraße 65 Leipzig 04229 Germany

volker.thieme_(at)_mac.com



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >how to combine addObject with Object instantiation? (From: Sandy Santra <email@hidden>)

  • Prev by Date: Re: Couldn't find minimal bounds for "_sigtramp" - backtraces may be unreliable
  • Next by Date: Re: Scheme????
  • Previous by thread: Re: how to combine addObject with Object instantiation?
  • Next by thread: Scheme????
  • Index(es):
    • Date
    • Thread