2010-01-05 11 views

Répondre

1

Vous pouvez créer NSIndexPath unique à l'aide

+ (NSIndexPath *)indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section; // defined in UITableView.h 

Votre code pour créer et remplir indexPaths paramater peut ressembler à:

NSMutableArray* indexPaths = [NSMutableArray arrayWithCapacity:10]; 
for (...) // iterate to get all indexes and section you need 
{ 
    [indexPaths addObject:[NSIndexPath indexPathForRow:someRow inSection:someSection]]; 
} 
//indexPaths is ready to use 
+0

Il est utile! Merci beaucoup, Vladimir – hungbm06

0
- (NSIndexPath *) indexPathForRow:(NSUInteger)row andSection:(NSUInteger)section { 
    NSUInteger _path[2] = {section, row}; 
    NSIndexPath *_indexPath = [[NSIndexPath alloc] initWithIndexes:_path length:2]; 
    return [_indexPath autorelease]; 
} 
+0

Alex, merci pour votre aide! – hungbm06

Questions connexes