Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8600817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:42:04+00:00 2026-06-12T01:42:04+00:00

I am trying to get a table view loaded with data from a Parse

  • 0

I am trying to get a table view loaded with data from a Parse backend to push a detail view with an image (PFFile) associated with the data in the table. I can get the data to load into the table fine but when segueing to new view controller the app crashes. Here is code from my PFQueryTableViewController implementation.

- (id)initWithCoder:(NSCoder *)aDecoder
{

self = [super initWithClassName:@"Wine"];
self = [super initWithCoder:aDecoder];

if (self) {

    self.className = @"Wine";

    self.textKey = @"Name";

    self.pullToRefreshEnabled = YES;


    self.paginationEnabled = YES;

    self.objectsPerPage = 50;
    self.sections = [NSMutableDictionary dictionary];
    self.sectionToWineTypeMap = [NSMutableDictionary dictionary];
}
return self;
}

- (void)viewWillAppear:(BOOL)animated
{

UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage   imageNamed:@"1.png"]];
[self.tableView setBackgroundView:imageView];

}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

return self.sections.allKeys.count;
}


- (NSString *)wineTypeForSection:(NSInteger)section {
return [self.sectionToWineTypeMap objectForKey:[NSNumber numberWithInt:section]];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{
NSString *wineType = [self wineTypeForSection:section];
NSArray *rowIndecesInSection = [self.sections objectForKey:wineType]; return   rowIndecesInSection.count;
}

- (CGFloat)tableView:(UITableView *)tableView
heightForHeaderInSection:(NSInteger)section {
return 40;
}  


- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UILabel *sectionHeader = [[UILabel alloc] initWithFrame:CGRectNull];
sectionHeader.backgroundColor = [UIColor groupTableViewBackgroundColor];
sectionHeader.textAlignment = UITextAlignmentCenter;
sectionHeader.font = [UIFont boldSystemFontOfSize:17];
sectionHeader.textColor = [UIColor whiteColor];
sectionHeader.text = [self wineTypeForSection:section];
return sectionHeader;
}

- (void)objectsDidLoad:(NSError *)error {
[super objectsDidLoad:error];


[self.sections removeAllObjects];
[self.sectionToWineTypeMap removeAllObjects];

NSInteger section = 0;
NSInteger rowIndex = 0;
for (PFObject *object in self.objects) {
    NSString *wineType = [object objectForKey:@"wineType"];
    NSMutableArray *objectsInSection = [self.sections objectForKey:wineType];
    if (!objectsInSection) {
        objectsInSection = [NSMutableArray array];

        [self.sectionToWineTypeMap setObject:wineType forKey:[NSNumber   numberWithInt:section++]];
    }

    [objectsInSection addObject:[NSNumber numberWithInt:rowIndex++]];
    [self.sections setObject:objectsInSection forKey:wineType];
}
}


- (PFQuery *)queryForTable {
PFQuery *query = [PFQuery queryWithClassName:self.className];

if (self.pullToRefreshEnabled) {
    query.cachePolicy = kPFCachePolicyNetworkOnly;
}

if (self.objects.count == 0) {
    query.cachePolicy = kPFCachePolicyCacheThenNetwork;
}

[query orderByAscending:@"orderIndex"];

return query;
}

- (PFObject *)objectAtIndexPath:(NSIndexPath *)indexPath {
NSString *wineType = [self wineTypeForSection:indexPath.section];

NSArray *rowIndecesInSection = [self.sections objectForKey:wineType];

NSNumber *rowIndex = [rowIndecesInSection objectAtIndex:indexPath.row];
return [self.objects objectAtIndex:[rowIndex intValue]];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath     *)indexPath object:(PFObject *)object {
static NSString *CellIdentifier = @"WineCell";

PFTableViewCell *cell = (PFTableViewCell *)[tableView    dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[PFTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault    reuseIdentifier:CellIdentifier];
}

cell.textLabel.text = [object objectForKey:@"Name"];
cell.detailTextLabel.text = [object objectForKey:@"Price"];

return cell;
}



- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {


if ([[segue identifier] isEqualToString:@"ShowWine"]) {

    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    PFObject *object = [self.objects objectAtIndex:indexPath.row];
    PFFile *file = [object objectForKey:@"image"];
    [[segue destinationViewController] setFile:file];

}
}

And here is the code from the Detail view controller header and implementation

@property (nonatomic, retain) PFFile *file;
@property (nonatomic, retain) PFImageView *detailImage;

Implementation

@implementation DetailVC
@synthesize file;
@synthesize detailImage;



- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
    // Custom initialization
}
return self;
}

-(void)viewDidAppear:(BOOL)animated

{
detailImage.file = file;

// Now tell PFImageView to download the file asynchronously
[detailImage loadInBackground];
}

- (void)viewDidUnload
{

[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:  (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end

And here is the error message I am getting.

Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key detail.’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:42:06+00:00Added an answer on June 12, 2026 at 1:42 am

    It is possible that there is still a connection to a, now non existing, IBOutlet named detail inside of your storyboard.

    Open your storyboard, open the Connection Inspector (press CMD+Option+6) and check the connections of your viewControllers for an invalid connection that is still linked to detail.

    Just remove that connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a specific cell from a table view so I can
I'm trying to get some data from a table, where the tag has no
I am trying to get JSON data loaded from a NSURLConnection delegate to send
I am trying to get Dates from RepDailyInfo table when the RepDailyCollection.IsReceived = 0
I am trying to get the privacy values (from privacy table) for photos that
I'm trying to get a row in my table view to resize its height,
I am trying to get the value of a cell in a table view
Hello I am trying to get profile image of facebook user in Table's cell.image.
I am trying to pass an image loaded from a UIImage instance to a
Does my code look right? I'm trying to load data into my table view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.