NSDictionary(GCKAdditions) 類別參考
總覽
這個類別會為 NSDictionary 新增一些便利方法,讓您安全地查詢各種類型的值。
這些方法特別適用於取得並設定 JSON 資料物件的欄位。
執行個體方法摘要 | |
(nullable NSString *) | - gck_stringForKey:withDefaultValue: |
利用指定備用值查詢鍵的 NSString 值。更多... | |
(nullable NSString *) | - gck_stringForKey: |
查詢鍵的 NSString 值 (備用值為 nil )。更多... | |
(NSInteger) | - gck_integerForKey:withDefaultValue: |
根據指定的備用值查詢鍵的 NSInteger 值。更多... | |
(NSUInteger) | - gck_uintegerForKey:withDefaultValue: |
針對具有指定備用值的鍵查詢 NSUInteger 值。更多... | |
(NSInteger) | - gck_integerForKey: |
查詢鍵的 NSInteger 值 (備用值為 0 )。更多... | |
(NSUInteger) | - gck_uintegerForKey: |
查詢鍵的 NSUInteger 值 (備用值為 0 )。更多... | |
(double) | - gck_doubleForKey:withDefaultValue: |
針對具有指定備用值的鍵查詢雙精度的值。更多... | |
(double) | - gck_doubleForKey: |
查詢鍵的雙精度值,備用值為 0.0 。更多... | |
(BOOL) | - gck_boolForKey:withDefaultValue: |
查詢具有指定備用值的鍵 BOOL 值。更多... | |
(BOOL) | - gck_boolForKey: |
查詢鍵的 BOOL 值,備用值為 NO 。更多... | |
(nullable NSDictionary *) | - gck_dictionaryForKey: |
查詢鍵的 NSDictionary 值,備用值為 nil 。更多... | |
(nullable NSArray *) | - gck_arrayForKey: |
查詢鍵的 NSArray 值 (備用值為 nil )。更多... | |
(nullable NSURL *) | - gck_urlForKey: |
查詢鍵的 NSURL 值 (備用值為 nil )。更多... | |
方法詳細資料
- (nullable NSString *) gck_stringForKey: | (NSString *) | key | |
withDefaultValue: | (nullable NSString *) | defaultValue | |
- (nullable NSString *) gck_stringForKey: | (NSString *) | key |
- (NSInteger) gck_integerForKey: | (NSString *) | key | |
withDefaultValue: | (NSInteger) | defaultValue | |
- (NSUInteger) gck_uintegerForKey: | (NSString *) | key | |
withDefaultValue: | (NSUInteger) | defaultValue | |
針對具有指定備用值的鍵查詢 NSUInteger 值。
- Parameters
-
key The key. defaultValue The default value to return if the key is not found or if its value is not an NSNumber.
- 傳回
- 鍵的值 (如果有找到且為 NSNumber),否則為預設值。
- (NSInteger) gck_integerForKey: | (NSString *) | key |
- (NSUInteger) gck_uintegerForKey: | (NSString *) | key |
- (double) gck_doubleForKey: | (NSString *) | key | |
withDefaultValue: | (double) | defaultValue | |
- (double) gck_doubleForKey: | (NSString *) | key |
- (BOOL) gck_boolForKey: | (NSString *) | key | |
withDefaultValue: | (BOOL) | defaultValue | |
- (BOOL) gck_boolForKey: | (NSString *) | key |
- (nullable NSDictionary *) gck_dictionaryForKey: | (NSString *) | key |
- (nullable NSArray *) gck_arrayForKey: | (NSString *) | key |