![]() ![]() ![]() ![]() |
|||||
|
|||||
樓主 daisuke ![]()
![]() |
Q1. 一個class要使用另一個class 為什麼要import那個class名稱?? 意義是? 我最近在作tableview 練習 雖然作出了效果但卻不明白為什麼拜託知道的高手能幫我解答一下底下註解的問題 ∼∼∼ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *table = @"table";// Q2.請問為什麼作tableview 都要加這段呢?? tableViewCell *cell = (tableViewCell *)[tableViewC dequeueReusableCellWithIdentifier:table]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"tableViewCell" owner:self options:nil];//Q3.這段是什麼意思可以幫我解釋一下嗎 cell = tblCell; } [cell setLabelText:[listData objectAtIndex:indexPath.row]]; [cell setImage:[listData2 objectAtIndex:indexPath.row]]; return cell; }
本篇文章發表於2012-02-15 18:09
== 簽名檔 ==
...... |
1樓 |
1. import是用來告訴compiler,需要import相關的libary,這樣程式才可以使用相關的API
2. static NSString *table = @"table"; 用來唯一識別cell用 3. [[NSBundle mainBundle] loadNibNamed:@"tableViewCell" owner:self options:nil]; 載入.nib檔使用
本篇文章回覆於2012-02-27 17:05
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
2樓
作者回應
daisuke ![]() |
感謝板主回答 > <
本篇文章回覆於2012-02-29 14:48
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
回覆 |
如要回應,請先登入. |