• 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: KVG generic enough?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVG generic enough?


  • Subject: Re: KVG generic enough?
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Wed, 18 Jul 2012 15:16:36 +0200

Le 18 juil. 2012 à 15:08, William Squires <email@hidden> a écrit :

>  Okay, after reading some of the documentation on KVC coding, I understand (I think) that the point is to allow me to specify a property of an object with an NSString, then set/get that property value using KVC (i.e. valueForKey: or setValue:forKey:). But it seems like the fact that there's no way to specify (or grab) the value of the property in a generic-enough manner would be a problem - anyone using it would still have to know the data type of the property they want to access, and thus they might as well just use the accessors. I can see this would work if ObjC had a generic data type (like the 'variant' data type in VB/REALbasic), but AFAIK, ObjC doesn't have such, and valueForKey: returns an id, right?
>  How can I determine what I get back? (i.e. what does the id pointer point to? an NSString? an NSNumber? NSDecimalNumber? NSData? another NSObject subclass?)
>
>

- [NSObject isKindOfClass:] ?


-- Jean-Daniel





_______________________________________________

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: 
 >KVG generic enough? (From: William Squires <email@hidden>)

  • Prev by Date: Re: do you init your instance variables in init method or outside the class?
  • Next by Date: Re: KVG generic enough?
  • Previous by thread: Re: KVG generic enough?
  • Next by thread: Re: KVG generic enough?
  • Index(es):
    • Date
    • Thread