Re: [問題] 如何等待alert結束?
※ 引述《markzog21 (殘羽星辰)》之銘言:
: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
: return [sectionArray count];
: }
UITableView 要求至少要有一個 section,你這邊最好改寫,
因為 array count 可能是 0。一旦回傳 0 就會出現 exception。
: - (UITableViewCell *)tableView:(UITableView *)tableView
: cellForRowAtIndexPath:(NSIndexPath *)indexPath
: {
: NSInteger row = [indexPath row];
: NSInteger section = [indexPath section];
: // Create a cell if one is not already available
: UITableViewCell *cell = [self.tableView
: dequeueReusableCellWithIdentifier:@"any-cell"];
: if (cell == nil)
: cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero
: reuseIdentifier:@"any-cell"] autorelease];
: // Set up the cell by coloring its text
: [cell.textLabel setText: [sectionArray objectAtIndex:0]];
呃,照你前面產生 NSMutableArray 的方式,[sectionArray objectAtIndex:0]
應該會回傳 NSArray,但是你現在卻把 NSArray 當做 NSString 用。
: return cell;
: }
--
zonble.net
cocoa.zonble.net
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.44.188.242
→
09/06 18:53, , 1F
09/06 18:53, 1F
→
09/06 18:54, , 2F
09/06 18:54, 2F
→
09/06 18:54, , 3F
09/06 18:54, 3F
→
09/06 18:54, , 4F
09/06 18:54, 4F
→
09/06 18:55, , 5F
09/06 18:55, 5F
→
09/06 18:55, , 6F
09/06 18:55, 6F
→
09/06 18:56, , 7F
09/06 18:56, 7F
→
09/06 18:56, , 8F
09/06 18:56, 8F
→
09/06 18:56, , 9F
09/06 18:56, 9F
推
09/06 19:59, , 10F
09/06 19:59, 10F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 8 之 8 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章