• 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: Cocoa equivalent for SetWindowProperty in Carbon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Displaying '%' in the UI (From: The Rhythmic <email@hidden>)
 >Re: Displaying '%' in the UI (From: Velocityboy <email@hidden>)
 >Cocoa equivalent for SetWindowProperty in Carbon (From: Sanjay Arora <email@hidden>)

  • Prev by Date: Re: Guidelines on using NSJSONSerialization
  • Next by Date: Re: Updating NSMenu while it's open
  • Previous by thread: Re: Cocoa equivalent for SetWindowProperty in Carbon
  • Next by thread: Updating NSMenu while it's open
  • Index(es):
    • Date
    • Thread