UA-17470720-3

Jump to content


Photo
- - - - -

sensibleKeyPath for setting properties


  • Please log in to reply
1 reply to this topic

#1 jpmcmobile

jpmcmobile

    Jr. Member

  • STV 3.0 Pro
  • PipPip
  • 11 posts
Reputation: 0
Neutral

Posted 10 December 2013 - 08:31 AM

Hi,

It looks like STV uses this method:

 

 - (id)valueForSensibleKeyPath:(NSString *)keyPath; 

 

in NSObject(SensibleCocoa) to retrieve the value of bound properties. The method supports an extended key path syntax that allows it to traverse arrays. However, the extended syntax only works when reading the value of a property, not when writing it. For instance:

 

SCSelectionCell *myCell = [SCSelectionCell cellWithText:@"My cell" boundObject:boundObject selectionStringPropertyName:@"myproperty.myarray[0]" items:@[@"A", @"B", @"C", @"D", @"E"]];

 

When the UITableView is displayed, myCell is correctly bound to the property value. However, when I modify the value of the cell, the app throws an exception saying that the key is not KVC-compliant.

 

Why doesn't STV also use the extended key path syntax when setting property values?

 

Thanks!



#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 10 December 2013 - 08:39 AM

Thanks Josef, we'll be using setValue:forSensibleKeyPath: in our next bug fix release.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users