https://github.com/wordpress-mobile/nsobject-safeexpectations
No more crashes getting unexpected values from a NSDictionary
https://github.com/wordpress-mobile/nsobject-safeexpectations
Last synced: 10 months ago
JSON representation
No more crashes getting unexpected values from a NSDictionary
- Host: GitHub
- URL: https://github.com/wordpress-mobile/nsobject-safeexpectations
- Owner: wordpress-mobile
- License: mit
- Archived: true
- Created: 2013-02-06T16:24:36.000Z (about 13 years ago)
- Default Branch: trunk
- Last Pushed: 2024-01-29T19:31:15.000Z (about 2 years ago)
- Last Synced: 2025-05-01T06:17:50.627Z (10 months ago)
- Language: Objective-C
- Size: 130 KB
- Stars: 19
- Watchers: 25
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](http://koke.github.com/NSObject-SafeExpectations/Categories/NSDictionary+SafeExpectations.html)
- (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:`