Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

allKeysメソッドの説明を修正する #83

Closed
ykokw opened this issue Dec 1, 2016 · 0 comments
Closed

allKeysメソッドの説明を修正する #83

ykokw opened this issue Dec 1, 2016 · 0 comments

Comments

@ykokw
Copy link
Contributor

ykokw commented Dec 1, 2016

http://mb.cloud.nifty.com/assets/sdk_doc/ios/doc/html/Classes/NCMBObject.html#//api/name/allKeys

上記allKeysメソッドの説明で「オブジェクトのキーを取得する。createdAt、updatedAt、objectIdは含まれない。」となっているが実際は含まれる。

  • 検証コード
  • あらかじめダッシュボードでDataクラスにnameフィールドを作成してテストデータを作成
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [NCMB setApplicationKey:@"xxxxx"
                  clientKey:@"xxxx"];
    
    NCMBObject *object = [NCMBObject objectWithClassName:@"Data"];
    
    //objectIdプロパティを設定
    object.objectId = @"xxxxx";
    
    //設定されたobjectIdをもとにデータストアからデータを取得
    [object fetchInBackgroundWithBlock:^(NSError *error){
        if (error){
            NSLog(@"%@", error.description);
        } else {
            NSArray *keys = object.allKeys;
            for (NSString *key in keys) {
                NSLog(@"%@", key);
            }
        }
    }];
    return YES;
}
  • 実行ログ
2016-12-01 11:51:23.040 ncmb_sample[3612:47619] createDate
2016-12-01 11:51:23.040 ncmb_sample[3612:47619] acl
2016-12-01 11:51:23.041 ncmb_sample[3612:47619] objectId
2016-12-01 11:51:23.041 ncmb_sample[3612:47619] name
2016-12-01 11:51:23.042 ncmb_sample[3612:47619] updateDate
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants