iOS removeObjectAtIndex

时间:2014-07-18 05:52:02

标签: ios objective-c

美好的一天!

我有这段代码来移除NSMutableArray中的特定database

-(void)removeDatabaseName:(NSString*)databaseName {
    // remove database from array of databases
    for (int index = 0; index < [[self.openDatabases objectForKey:@"databaseName"] count]; index++) {
        if ([[self.openDatabases objectForKey:@"databaseName"] objectAtIndex:index] == databaseName) {

            //Match
            [[self.openDatabases objectForKey:@"database"] removeObjectAtIndex:index];
            [[self.openDatabases objectForKey:@"databaseName"] removeObjectAtIndex:index];
            [[self.openDatabases objectForKey:@"location"] removeObjectAtIndex:index];
            NSLog(@"removed database");
            break;
        }
    }
}

结果,它显示 NSLog(@&#34;删除数据库&#34;); 但我不知道它是否在NSMutableArray中被完全删除或者我是否我错了可以至少删除特定文件吗?

0 个答案:

没有答案