2012-09-14 22 views
11
#define PROPERTY_SECTION 0 
#define SUBTOTAL_ROW 0 

UITableViewCell *subtotalCell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:SUBTOTAL_ROW inSection:PROPERTY_SECTION]]; 

kullanmak, Ama ios 5 uygulama nedeni"Uygulama Kilitlenme iOS5

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSIndexPath indexPathForItem:inSection:]: unrecognized selector sent to class 0x1d41f20' 
*** First throw call stack: 
(0x26b4022 0x2083cd6 0x26b5aad 0x261aed0 0x261acb2 0xc956a 0xc9d4a 0xca3e9 0x12af38f 0x12af5eb 0x12bdb2b 0x12af38f 0x12af5eb 0x12b04ed 0x121da0c 0x26b5e99 0x121e464 0x121e495 0x1222fc1 0x121d14b 0x16864ce 0x162bd61 0x16114d0 0x12ae5ab 0x4ab35 0x14ade29 0x14ad133 0x14ae3bf 0x14b0a21 0x14b097c 0x14a93d7 0x268899e 0x261f640 0x25eb4c6 0x25ead84 0x25eac9b 0x2d167d8 0x2d1688a 0x11e6626 0x248d 0x23b5) 
terminate called throwing an exception(lldb) 

cevap

47

+ (NSIndexPath *)indexPathForItem:(NSInteger)item inSection:(NSInteger)section; 5 bir yöntem yalnızca muhtemelen

8

Kullanım

indexPathForRow:inSection: için

arıyoruz 5. iOS'taki UITableView bunu kullanamaz iOS 6'da UICollectionView çalışır olduğunu

[NSIndexPath indexPathForRow:indexRow inSection:indexSection];

yerine

[NSIndexPath indexPathForItem:indexRow inSection:indexSection];