Re: Cocoa equivalent for SetWindowProperty in Carbon
Re: Cocoa equivalent for SetWindowProperty in Carbon
- Subject: Re: Cocoa equivalent for SetWindowProperty in Carbon
- From: Eric Schlegel <email@hidden>
- Date: Thu, 19 Apr 2012 08:28:50 -0700
On Apr 17, 2012, at 11:53 PM, Sanjay Arora <email@hidden> wrote:
> Hi I am a newbie on Cocoa application development and could not find any
> method in NSWindow which does the same job as SetWindowProperty used to
> do in Carbon,
>
> Could some one point me to right direction.
Hi Sanjay,
I can think of two ways to do this:
- use the objc_setAssociatedObject API in objc/runtime.h
- create a subclass of NSWindow, add some custom properties to your class, and store your data in those properties
The latter is actually an approach that we would recommend in recent Carbon programming too; the equivalent Carbon technique would be creating an HIObject subclass of the WindowRef base class, and adding your own private data fields to your subclass.
-eric
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden