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

how to combine addObject with Object instantiation?


  • Subject: how to combine addObject with Object instantiation?
  • From: Sandy Santra <email@hidden>
  • Date: Sun, 03 May 2009 15:53:07 -0400

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

  • Follow-Ups:
    • Re: how to combine addObject with Object instantiation?
      • From: ANE <email@hidden>
    • Re: how to combine addObject with Object instantiation?
      • From: Chris Espinosa <email@hidden>
  • Prev by Date: Re: Removing "Missing images" from Interface Builder
  • Next by Date: Scheme????
  • Previous by thread: Re: Removing "Missing images" from Interface Builder
  • Next by thread: Re: how to combine addObject with Object instantiation?
  • Index(es):
    • Date
    • Thread