我正在嘗試訪問QuickDialog窗體的UITableViewCell的屬性。如何訪問QuickDialog單元格元素的UITableViewCell?
更具體地說,我試圖訪問QEntryElement(QDateTimeInlineElement)的accessoryView屬性,該屬性在我創建的對象的屬性列表中「隱藏」。
我試圖訪問使用
UITableViewCell *thisCell = [dateelement getCellForTableView:self.quickDialogTableView controller:self];
細胞,但由於某些原因不顯示任何內容。我想在這上面插入一個UIButton,像這樣:
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setTitle:@"=" forState:UIControlStateNormal];
button.frame = CGRectMake(0, 0, 24, 24);
然後 thisCell.accessoryView =按鈕;
我是否以錯誤的方式訪問屬性,或者可能沒有創建按鈕?沒有錯誤顯示,但accessoryView是空的。
預先感謝您
你不能只調用[element getCellForTableView],因爲直到tableview試圖顯示它們,單元才真正存在。這是UITableView用來顯示數據的表示模型。 – 2012-07-27 14:04:09