I want to convert NSIndexPath
to NSString
. How would I do it?
I have to use this:
- (void)restClient:(DBRestClient*)client uploadedFile:(NSString*)sourcePath
{
[client deletePath:@"/objc/boston_copy.jpg"];
}
inside commitEditingStyle method where I only get NSIndexPath
as input.
- (void)tableView:(UITableView *)aTableView
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath :(NSIndexPath *)indexPath
{
[self.itemArray removeObjectAtIndex:indexPath.row];
[aTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:YES];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0]
withRowAnimation:UITableViewRowAnimationFade];
}
I made this a category on NSIndexPath at one point in time:
@interface NSIndexPath (StringForCollection)
-(NSString *)stringForCollection;
@end
@implementation NSIndexPath (StringForCollection)
-(NSString *)stringForCollection
{
return [NSString stringWithFormat:@"%d-%d",self.section,self.row];
}
@end