0
我有一個非常奇怪的問題。這裏是我應該把我的UITableViewCell文本標籤和詳細文本標籤的代碼:問題與UITableView cellForRowAtIndexPath與NSManagedObjects
[[cell textLabel] setText:[[recentSearches objectAtIndex:indexPath.row] name]];
[[cell detailTextLabel] setText:[formatter stringFromDate:[[recentSearches objectAtIndex:indexPath.row] date]]];
recentSearches
是RecentSearch
對象,這是NSManagedObjects
的NSArray
。對象具有兩個實例變量:NSString *name
和NSDate *date
;
當我嘗試顯示我的表格時,我得到空白單元格,雖然單元格確實出現。更奇怪的是,當我選擇一個,didSelectRowAtIndexPath
將數據並正確地將其傳輸到另一個視圖。
任何建議將非常有幫助。我很難過!
您使用的是什麼樣的單元格樣式?你可以在'cellForRowAtIndexPath:'方法中NSLog''對象嗎? – Eimantas