0
驗證碼心不是莫名其妙地工作查詢在parse.com導致我的應用程序退出
//setup cell
static NSString *CellIdentifier = @"Cell";
ParseExampleCell *Cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
PFObject *tempObject = [detailArray objectAtIndex:indexPath.row];
Cell.cellTitle.text = [tempObject objectForKey:@"Exibitor"];
即時得到
'NSInvalidArgumentException', reason: '-[UITableViewCell cellTitle]: unrecognized selector sent to instance 0x10d959830'
我嘗試設置,當用戶點擊一個表項將去到一個詳細視圖控制器Exibitor是在parse.com數據庫中的正確的類
- (id)initWithCoder:(NSCoder *)aCoder {
self = [super initWithCoder:aCoder];
if (self) {
// Customize the table
// The className to query on
self.parseClassName = @"Exibitor";
// The key of the PFObject to display in the label of the default cell style
//self.textKey = @"name";
// Uncomment the following line to specify the key of a PFFile on the PFObject to display in the imageView of the default cell style
//self.imageKey = @"Logo";
// Whether the built-in pull-to-refresh is enabled
//self.pullToRefreshEnabled = YES;
// Whether the built-in pagination is enabled
//self.paginationEnabled = YES;
// The number of objects to show per page
//self.objectsPerPage = 8;
}
return self;
}
- (void)viewDidLoad
{
//_itemsArray = [NSMutableArray];
// _detailArray = [NSMutableArray];
[self performSelector:@selector(retrieveFromParse)];
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
然後我有代碼的其餘
- (void) retrieveFromParse {
PFQuery *query = [PFQuery queryWithClassName:@"Exibitor"];
[query whereKey:@"Wedding" equalTo:[NSNumber numberWithBool:YES]];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
detailArray = [[NSMutableArray alloc] initWithArray:objects];
}
//[detailArray reloadData];
}];
}
多數民衆贊成我有香港專業教育學院把大部分它作爲即時通訊試圖找出究竟發生了什麼上
你能暴露你的ParseExampleCell類嗎? – james075
添加了其他代碼。 ps im新到parse.com。我嘗試過各種方式來顯示數據。我確實在一次嘗試中顯示數據,但它不在數組中 –
您需要粘貼更多的代碼,也可能還包含頭文件 - 問題似乎是單元格的分配方式與UITableViewCell類似,而不是您的單元類,而不是單元類。 cellTitle作爲屬性。 – PetrV