ページの先頭行へ戻る
Interstage Mobile Application Server V1.3.0 アプリケーション開発ガイド
FUJITSU Software

3.4.5.3 データの削除、データ数およびキーの取得

SLSのAPIでは、格納されたデータの削除やキーを取得できます。以下は認証レスモードの例です。

使用例
- (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) {
            // それぞれのエラーの実装
        }
    }
}