Parse.com에서 정보를 읽어야하는 Xcode 앱이 있습니다.Xcode에서 개체를 검색 할 수 없습니다.
- (void) initializeContent
{
[self queryParse: @"MyClassName"];
}
- (void) queryParse:(NSString *) className
{
NSLog(@"Class Name Is: %@", className);
PFQuery *query = [PFQuery queryWithClassName:className];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error)
{
if (!error)
{
myObjectsArray = [[NSArray alloc] initWithArray:objects];
NSLog(@"Objects Array: %@", myObjectsArray);
}
else
{
NSLog(@"Error retrieving objects: %@ %@", error, [error userInfo]);
}
}];
}
이것은 구문 분석에서 개체를 반환 내있는 viewDidLoad에서
나는 호출
[self initializeContent];
를 호출합니다. 이 방법은 NULL을 반환하고 왜 두 번에 호출되는 이유
그러나, 다음은 구문 분석에서 아무것도 반환하지 않으며 방법은 스택 트레이스에서 볼 수 있듯이 두 번 호출됩니다
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
PFObject *tempObject = [myObjectsArray objectAtIndex:indexPath.row];
NSLog(@"Temp Object: %@", tempObject);
cell.textLabel.text = [tempObject objectForKey:@"MyClassName"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
는 아는 사람 있나요 cellForRowAtIndexPath 메소드?