我創建一個自定義的UITableViewCell一個UITableView,我就是這樣在cellForRowAtIndexPath
創建單元格:UITableViewCell中獲得零
static NSString *CellIdentifier = @"SongsCell";
SongsCell *cell = (SongsCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil){
UIViewController *vc = [[[UIViewController alloc] initWithNibName:@"SongsCell" bundle:nil] autorelease];
cell = (SongsCell *) vc.view;
}
現在我想,當一個按鈕來獲得表中的信息的所有單元格(從小區參數)按:
for (int i = 0; i < [songTable numberOfRowsInSection:0]; i++)
{
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
UITableViewCell *cell = [songTable cellForRowAtIndexPath:indexPath];
}
現在我有這個循環給我cell
一比零對於目前未在表中看到的所有細胞的一個問題。
我想循環表中的所有單元格。 – MTA 2012-03-25 11:19:24
你爲什麼要循環通過細胞?我認爲這不會給你你期望的結果。 – sch 2012-03-25 11:28:09
Thx的幫助,我做了一些其他的東西,我想要做的事情。 – MTA 2012-03-25 14:26:43