NSObject-SafeExpectations 0.0.3

NSObject-SafeExpectations 0.0.3

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2018

Maintained by Aaron Douglas, Paolo Musolino, Sérgio Estêvão, Jorge Leandro Perez, Diego Rey Mendez, Diego Rey Mendez, Gerardo Pacheco, Brandon Titus, Jorge Bernal, Matt Bumgardner, Elisa Budelli, Eduardo Toledo, Cesar Tardaguila, Thuy Copeland, Lorenzo Mattei, Eric Johnson, James Frost, Stephenie Harris, Daniele Bogo, Jaclyn Chen, Chip Snyder, Jeremy Massel, Pinar Olguc, Emily Laguna, Leandro Alonso, Stefanos Togoulidis, Ceyhun Ozugur, Paul Von Schrottky, Jayson Basañes, Rachel McRoberts, Yael Rubinstein, Giorgio Ruscigno, Automattic Mobile.



  • By
  • Jorge Bernal and Aaron Douglas

NSObject+SafeExpectations

No more crashes getting unexpected values from a NSDictionary.

Usage

There are a few new methods available for a NSDictionary: see the documentation

  • (NSString *)stringForKey:(id)key;
  • (NSNumber *)numberForKey:(id)key;
  • (NSArray *)arrayForKey:(id)key;
  • (NSDictionary *)dictionaryForKey:(id)key;
  • (id)objectForKeyPath:(NSString *)keyPath;
  • (NSString *)stringForKeyPath:(id)keyPath;
  • (NSNumber *)numberForKeyPath:(id)keyPath;
  • (NSArray *)arrayForKeyPath:(id)keyPath;
  • (NSDictionary *)dictionaryForKeyPath:(id)keyPath;

Wishlist

  • NSArray: stringAtIndex:, numberAtIndex:, arrayAtIndex:, dictionaryAtIndex:
  • Collections support for objectForKeyPath: