I have a picture app with a queue in it. I want the user to be able to delete images from it, but not the one being uploaded. So I have something like this:
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
//NSString *indexPathString = [NSString stringWithFormat:@"%d", indexPath];
NSString *theObject = [processList objectAtIndex:0];
NSLog(@"theObject: %@", theObject);
NSString *theStatus;
NSArray *resultstwoo = [database executeQuery:@"SELECT * FROM processes WHERE image=?", theObject];
for (NSDictionary *rowtwoo in resultstwoo) {
theStatus = [rowtwoo valueForKey:@"status"];
}
NSLog(@"the status: %@", theStatus);
if ([theStatus isEqualToString:@"Uploading..."]) {
return UITableViewCellEditingStyleNone;
} else if ([theStatus isEqualToString:@"Resizing..."]) {
return UITableViewCellEditingStyleNone;
} else {
return UITableViewCellEditingStyleDelete;
}
}
Even though my NSLog says it’s “Uploading…”, it still shows the delete button.
Please help, thanks:
Coulton!
did you try
let it return NO if it’s uploading?