NSObject(SensibleCocoa)

@interface NSObject (SensibleCocoa)

/**
 This method allows accessing array values in a regular key-path string by placing the array item index between brakets.
 
 Examples: 
    firstSaleAmount = [customer valueForSensibleKeyPath:@"salesData.invoices[0].amount"];
    lastSaleAmount = [customer valueForSensibleKeyPath:@"salesData.invoices[n].amount"];
    saleBeforeLastAmount = [customer valueForSensibleKeyPath:@"salesData.invoices[n-1].amount"];
 */
- (instancetype)valueForSensibleKeyPath:(NSString *)keyPath;

/** Similar to valueForSensibleKeyPath, this method uses a Sensible keyPath to set a value. */
- (void)setValue:(id)value forSensibleKeyPath:(NSString *)keyPath;

@end

Undocumented

  • This method allows accessing array values in a regular key-path string by placing the array item index between brakets.

    Examples: firstSaleAmount = [customer valueForSensibleKeyPath:@“salesData.invoices[0].amount”]; lastSaleAmount = [customer valueForSensibleKeyPath:@“salesData.invoices[n].amount”]; saleBeforeLastAmount = [customer valueForSensibleKeyPath:@“salesData.invoices[n-1].amount”];

    Declaration

    Objective-C

    - (instancetype)valueForSensibleKeyPath:(NSString *)keyPath;
  • Similar to valueForSensibleKeyPath, this method uses a Sensible keyPath to set a value.

    Declaration

    Objective-C

    - (void)setValue:(id)value forSensibleKeyPath:(NSString *)keyPath;