在parse.com中查询导致我的应用退出

时间:2014-07-20 14:00:39

标签: ios xcode5 parse-platform

此代码无法以某种方式工作

    //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];
    }];
}

多数民众赞成我所有我已经把大部分时间都拿出来,因为我试图找出发生了什么事情

1 个答案:

答案 0 :(得分:0)


使用此文档PFQueryTableViewController 这帮助了我。 您也可以按照本教程PFQueryTableViewController

进行操作