KiiObject の削除
KiiObject を削除するには、次の例のように delete(_:)
メソッドをコールします。
Swift:
-
// Instantiate a KiiObject with its URI. let object = KiiObject(uri: "Set the URI of an existing KiiObject here")! do{ // Delete the KiiObject. try object.deleteSynchronous() } catch let error as NSError { // Handle the error. return }
-
// Instantiate a KiiObject with its URI. let object = KiiObject(uri: "Set the URI of an existing KiiObject here")! // Delete the KiiObject. object.delete { (object : KiiObject?, error : Error?) -> Void in if error != nil { // Handle the error. return } }
Objective-C:
-
// Instantiate a KiiObject with its URI. KiiObject *object = [KiiObject objectWithURI:@"Set the URI of an existing KiiObject here"]; NSError *error; // Delete the KiiObject. [object deleteSynchronous:&error]; if (error != nil) { // Handle the error. return; }
-
// Instantiate a KiiObject with its URI. KiiObject *object = [KiiObject objectWithURI:@"Set the URI of an existing KiiObject here"]; // Delete the KiiObject. [object deleteWithBlock:^(KiiObject *object, NSError *error) { if (error != nil) { // Handle the error. return; } }];
KiiObject は delete(_:)
メソッドを呼ぶことで削除されます。別途save(_:)
メソッドを呼ぶ必要はありません。
削除対象 KiiObject が Object Body を持っていた場合は、Object Body とその公開済み URL も同時に削除されます。詳細は Object Body の削除 をご覧ください。
複数件の KiiObject をまとめて削除する API はありませんが、Bucket ごとまとめて削除することは可能です。詳細は Bucket の削除 をご覧ください。