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

Re: Building and access objects at runtime[SOLVED)


  • Subject: Re: Building and access objects at runtime[SOLVED)
  • From: "Peter Karlsson" <email@hidden>
  • Date: Tue, 03 Aug 2004 08:26:42 +0000

I got it now, thanks Matt.

// This is the code that moves a object selected in my popup. I give my objects a unique tag when they are created and then I use viewWithTag to find the right object in my view.

NSSlider *targetSlider = [myView viewWithTag:[selectPopupOutlet indexOfSelectedItem]];
[targetSlider setFrame: NSMakeRect(xPos, yPos, 133, 21)];
[myView setNeedsDisplay:YES];

Is it possible to get the x and y coordinates directly from my slider object so I don't need to store the coordinates somewhere?

Best regards Peter

From: Matt Neuburg <email@hidden>
To: Peter Karlsson <email@hidden>
CC: <email@hidden>
Subject: Re: Building and access objects at runtime
Date: Mon, 02 Aug 2004 12:13:38 -0700

On Mon, 02 Aug 2004 13:25:31 +0000, "Peter Karlsson" <email@hidden>
said:
>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...

If these "objects" are all views, assign a tag as a unique identifier. Then
you can ask the superview for its subview with that tag. m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
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.


_________________________________________________________________
Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/
_______________________________________________
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: Re: Binding woes, connecting model to NSArrayController, crash on remove/insert
  • Previous by thread: Re: Binding woes, connecting model to NSArrayController, crash on remove/insert
  • Index(es):
    • Date
    • Thread