• 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: Finding a view (Cocoa theory)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding a view (Cocoa theory)


  • Subject: Re: Finding a view (Cocoa theory)
  • From: Carl Gieringer <email@hidden>
  • Date: Fri, 18 Feb 2005 17:27:55 -0900

Hi,

I am a little confused by your question: from any spot in the view hierarchy, what other view would you be looking for? How would you know if you had found it? E.g., if you would be looking for a view via a "unique ID", how would your original view get the id in the first place, and if it got the id at some point in a program, couldn't it just as easily have gotten a reference to the view?

Maybe these methods are of use?

NSView:

- ancestorSharedWithView:
- isDescendantOf:

NSWindow:

- windowNumber

Also check the function NSWindowList at:

http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Functions/AppKitFunctions.html

This mentions NSConvertWindowNumberToGlobal:

http://www.toodarkpark.org/computers/objc/AppKit/Functions/ AppKitFunctions.html

Lastly some window server/NSApp reference:

http://www.oreilly.com/catalog/learncocoa/chapter/ch06.html

On Feb 18, 2005, at 16:00, Mark Dawson wrote:

Does Cocoa allow finding an NSView? From what I can tell, there isn't any unique ID for a view, so from any spot in a view hierarchy, it doesn't seem programatically possible to find a view that's either a sibling, super, or sub view from any particular view. Is that correct? So, if you want to use any particular view, you need to set it up as an outlet, correct?

Thanks,

Mark

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


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Finding a view (Cocoa theory) (From: Mark Dawson <email@hidden>)

  • Prev by Date: Re: returning NO from readFromFile:ofType: causes exception
  • Next by Date: Re: Finding a view (Cocoa theory)
  • Previous by thread: Re: Finding a view (Cocoa theory)
  • Next by thread: Re: Finding a view (Cocoa theory)
  • Index(es):
    • Date
    • Thread