SLSのAPIでは、格納されたデータの削除やキーを取得する事ができます。以下は認証レスモードの例です。
try { DataManagerModeLessDirect dm = new DataManagerModeLessDirect(getApplicationContext()); int count = dm.getListLength(); for (int i=count-1; i >= 0; i--){ String key = dm.getKeyFromIndex(i); dm.remove(key); } } catch (IMAPSSlsException e) { // 例外処理. }
- (void)func { NSError *anError = nil; IMADataManagerModeLessDirect *manager = [[IMADataManagerModeLessDirect alloc] init]; NSNumber *count = [manager getListLength:&anError]; if (count == nil) { // それぞれのエラーの実装. } int intCount = [count intValue]; for(int i = intCount-1; i >= 0; i--) { NSString *key = [manager getKeyFromIndex:i error:&anError]; if (key == nil) { // それぞれのエラーの実装. } BOOL ret = [manager remove:key error:&anError]; if (ret == NO) { // それぞれのエラーの実装 } } }
try { DataManagerModeLessDirect dm = new DataManagerModeLessDirect(); int count = dm.getListLength(true); for (int i=count-1; i >= 0; i--) { string key = dm.getKeyFromIndex(i); dm.remove(key); } } catch (IMAPSSlsException e) { // 例外処理 }