• 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: Best way to bind an Inspector to iVars/Properties?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to bind an Inspector to iVars/Properties?


  • Subject: Re: Best way to bind an Inspector to iVars/Properties?
  • From: Jon Hess <email@hidden>
  • Date: Fri, 07 Dec 2007 11:10:57 -0800

Hey Gordon -

I usually keep the iVar as a struct and then make getters and setters for the exposed values of the structure. For example: I would have struct that is an NSRect named frame and a method frameWidth then I would bind to frameWidth.

Good Luck -
Jon Hess

On Dec 7, 2007, at 8:53 AM, Gordon Apple <email@hidden> wrote:

I'm currently wrestling with how to bind inspector components to the
variables of an object. I'm also becoming a Talmudic scholar of the Sketch
example, although my architecture is substantially different. (I have to
actually understand it, not just use it.)


My Shape objects are not based on subclasses, but on a highly variable
list of properties. Structs are currently stored as NSValues, which made
for easy archiving until I started trying to use keyed archivers. That and
other issues have brought up the following considerations. What is the best
way to handle structs like NSRect, NSSize, NSPoint and be able to bind my
inspector to them?


1. Store as an NSValue (like I started) and use custom property accessors
to bind to the components.


2.  Create my own NSObject-based classes for these structs

3.  Create a proxy holder class for these structs (with accessors)

4.  Store all components in my props dictionary as individual NSNumber
components

5. Store components in their own dictionary within my props dictionary

6. Give up on structs in my props dictionary and use separate iVars with
component accessors (i.e, the Sketch approach)


7.  Something entirely different

8.  Find a new career which pays better with shorter hours

   Any thoughts or experiences?

_______________________________________________

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
_______________________________________________

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: 
 >Best way to bind an Inspector to iVars/Properties? (From: Gordon Apple <email@hidden>)

  • Prev by Date: Re: Imaginary File Path
  • Next by Date: Re: trouble keeping NSTableView sorted
  • Previous by thread: Best way to bind an Inspector to iVars/Properties?
  • Next by thread: Re: Best way to bind an Inspector to iVars/Properties?
  • Index(es):
    • Date
    • Thread