• 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
Building and access objects at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building and access objects at runtime


  • Subject: Building and access objects at runtime
  • From: "Peter Karlsson" <email@hidden>
  • Date: Mon, 02 Aug 2004 13:25:31 +0000

Dear list!

I can build a object programatically this way:

NSButton *myButton = [[NSButton alloc] initWithFrame:(0, 0, 100, 100)];

I use the name 'myButton' when I for some reason want to access the object, so far so good. If I need another button I name it 'myButton2' and everything is ok but...

If the user programatically build objects at runtime, how do I access the objects if I don't know how many objects there will be? I suppose I must use a NSMutableArray to store the objects. But how do I access them separately?

Example:

I want to move the first object in my array to a new position on my view, then I want to move the second object to another positon and so on...

Besta regards Peter

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: [ANN] Tag 1.1 Released
  • Next by Date: Preference pane lifecycle when opened from Finder/CFMessagePortSendRequest fails silently
  • Previous by thread: [ANN] Tag 1.1 Released
  • Next by thread: Re: Building and access objects at runtime
  • Index(es):
    • Date
    • Thread