2011-05-31 85 views
0

Goodmorning SO,accessoryType在行上隨機消失

我這個問題已經像整整一週現在這麼奇怪了。

我得到了充滿VM的一個表,我可以打開/關閉/重新啓動等。並且每一行都有一個UITableViewCellAccessoryDetailDisclosureButton 當我發送到虛擬機的動作,我檢查每3秒,如果動作已成功在等待UITableViewCellAccessoryDetailDisclosureButton時完成的操作被活動指示器取代。當操作完成時,虛擬機所在的行應刷新,此操作正常。 但問題是,有時..真的有時UITableViewCellAccessoryDetailDisclosureButton doesnt回來時,一個虛擬機完成,並沒有accessoryType annymore一行。這只是在隨機行,我發送一個動作... 讓我們說我有5排。

X*  
X* 
X* 
X* 
X* 

X =行,* = UITableViewCellAccessoryDe​​tailDisclosureButton) 和我打開所有的人都那麼這種情況

X 
X 
X* 
X* 
X 

然後在隨機的地方UITableViewCellAccessoryDe​​tailDisclosureButton disappeares和犯規回來,直到我重新整UIView的。

這是爲什麼? 這是一些代碼。

[activityView stopAnimating]; 
[timer invalidate]; 
NSArray *indexPathArray = [NSArray arrayWithObject:TheindexPath(This is the indexpath of the row where an action should be done.)]; 
[TheTableWithMachines reloadRowsAtIndexPaths:indexPathArray withRowAnimation:UITableViewRowAnimationFade]; 
[activityView release]; 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 

我甚至檢查單元格上的按鈕或不如果不是..添加環視了很多後

if(cell.accessoryType != UITableViewCellAccessoryDetailDisclosureButton) 
     { 
      cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; 
     } 

我得到了它終於修好了!

活動指示器是一個AccesoryView,UITableViewCellAccessoryDe​​tailDisclosureButton是我剛設置這個[cell setAccessoryView:nil]所需的單元的AccesoryType;在代碼結尾

但我仍然不知道爲什麼UITableViewCellAccessoryDe​​tailDisclosureButton有時消失。

annyway它現在的作品。

回答