2011-03-26 33 views
0

我在Objective-C是新的閱讀單元格的值,我想UR幫助 我的問題是,我有10個細胞的tableview每一個細胞都帶有一些數據,都來自tabase場後,我改變某些單元格的值的從表視圖,現在我想讀表視圖的新值表視圖重載這一切後單元格的值的話,我該怎麼辦 我怎樣才能將其存儲在新的數組 我試圖做這樣的事情是正確的或沒有如果沒有的話,我該怎麼辦在viewWillAppear中從tableview中

[標籤

-(void)viewWillAppear:(BOOL)animated // after new value will insert 
{ 

[tableView reloadData]; 
NSArray *visibleRowsArr = [tableView indexPathsForVisibleRows]; 

UITableViewCell *cell = [tableView cellForRowAtIndexPath:[visibleRowsArr objectAtIndex:0]]; 


} 

回答

0

leview reloadData]應在viewWillAppear中結束即前}

+0

感謝它現在的工作 – 2011-03-26 12:12:14

+0

ok.ok.ok.ok.ok.ok.ok.ok.ok. – 2011-03-26 12:33:18

0

就是這麼簡單,你可以嘗試使用您從中重新加載整個表在同一陣列。

因爲畢竟這陣會一直更新,所以沒有必要讀TableViewCells的記錄,但嘗試使用Array使用。

喜歡:

int AtOurWish =5; 

-(void)viewWillAppear:(BOOL)animated // after new value will insert 
{ 
    [super viewWillAppear:animated]; 

[self.YourArray objectAtIndex:AtOurWish];//Index At which you want to access the array 

[tableView reloadData]; 
NSArray *visibleRowsArr = [tableView indexPathsForVisibleRows]; 

UITableViewCell *cell = [tableView cellForRowAtIndexPath:[visibleRowsArr objectAtIndex:0]]; 


} 

否則你編輯的問題,因爲它沒有太多明確的!