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 7818387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:33:36+00:00 2026-06-02T06:33:36+00:00

I have an array called [self.places objectAtIndex:indexPath.row]; that I am trying to output into

  • 0

I have an array called [self.places objectAtIndex:indexPath.row]; that I am trying to output into a table. The array is full of objects but I want to use the data inside the object whats the best way to assign them to an object? The data inside the array is as follows:

<Place:eXMSFqDg7B> {
    Location = "<PFGeoPoint: 0x6887480>";
    addressline1 = "address line 1";
    addressline2 = "address line 2";
    agerestrictions = "18+";
    email = "test@aol.com";
    image = "<PFFile: 0x6887af0>";
    name = "Rain NightClub";
    phone = 0123456789;
    postcode = BT11TG;
    type = Club;
}
2012-04-17 00:29:59.501 ClubsNIparse[3517:f803] <Place:95KvPCrSY1> {
    Location = "<PFGeoPoint: 0x6888330>";
    addressline1 = "address line 1";
    addressline2 = "address line 2";
    agerestrictions = "18+";
    email = "test@aol.com";
    image = "<PFFile: 0x6888950>";
    name = "Box NightClub";
    phone = 0123456789;
    postcode = BT11TG;
    type = Club;
}
2012-04-17 00:29:59.502 ClubsNIparse[3517:f803] <Place:6AxpfrY0DZ> {
    Location = "<PFGeoPoint: 0x6889260>";
    addressline1 = "address line 1";
    addressline2 = "address line 2";
    agerestrictions = "18+";
    email = "test@aol.com";
    image = "<PFFile: 0x6889880>";
    name = Laverys;
    phone = 0123456789;
    postcode = BT11TG;
    type = Club;
}

Thanks.

EDIT —

As suggested a created an NSObject and set the fields respectively but received this error:
2012-04-17 11:09:08.363 ClubsNIparse[4906:f803] -[PFObject Location]: unrecognized selector sent to instance 0x6b4e4a0
2012-04-17 11:09:08.364 ClubsNIparse[4906:f803] * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[PFObject Location]: unrecognized selector sent to instance 0x6b4e4a0’
*
First throw call stack:
(0x19d5052 0x1f89d0a 0x19d6ced 0x193bf00 0x193bce2 0x13434 0xc01e0f 0xc02589 0xbeddfd 0xbfc851 0xba7301 0x19d6e72 0x1a992d 0x1b3827 0x139fa7 0x13bea6 0x1c730c 0xb79530 0x19a99ce 0x1940670 0x190c4f6 0x190bdb4 0x190bccb 0x251f879 0x251f93e 0xb68a9b 0x2722 0x2695)
terminate called throwing an exceptionCurrent

My Code is as follows:

Place.h (NSObject)

@interface Place : NSObject
{
    NSString * Location;
    NSString * addressline1;
    NSString * addressline2;
    NSString * agerestrictions;
    NSData * image;
    NSString * email;
    NSString * name;
    NSString * phone;
    NSString * postcode;
    NSString * type;

}

@property (nonatomic, retain) NSString * Location;
@property (nonatomic, retain) NSData * image;
@property (nonatomic, retain) NSString * addressline1;
@property (nonatomic, retain) NSString * addressline2;
@property (nonatomic, retain) NSString * agerestrictions;
@property (nonatomic, retain) NSString * email;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSString * phone;
@property (nonatomic, retain) NSString * postcode;
@property (nonatomic, retain) NSString * type;

-(NSComparisonResult) compareWithAnotherPerson:(Place*) p;

@end

Place.m

#import "Place.h"

@implementation Place

@synthesize name,addressline1,addressline2,email,phone,postcode,type,agerestrictions;
@synthesize Location,image;

-(void) dealloc
{

    self.name = nil;
    self.addressline1 = nil;
    self.addressline2 = nil;
    self.email = nil;
    self.phone = nil;
    self.postcode = nil;
    self.type = nil;
    self.agerestrictions = nil;
    self.Location = nil;
    self.image = nil;


    [super dealloc];


}

-(NSComparisonResult) compareWithAnotherPerson:(Place*) p
{
    return [[self name] compare:[p name]];
}


@end

TableView.h (where I want to list data)

#import <UIKit/UIKit.h>
#import <Parse/Parse.h>

@class Place;

@interface NearbyViewController : UITableViewController
{
    NSArray * places;
}

@property (nonatomic,retain) NSArray * places;

@end

TableView.m

#import "NearbyViewController.h"
#import <Parse/Parse.h>
#import "Place.h"

@implementation NearbyViewController

@synthesize places;

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    self.title = @"Nearby";
    PFGeoPoint *userGeoPoint = [PFGeoPoint geoPointWithLatitude:37.856965 longitude:-122.483826];
    PFQuery *query = [PFQuery queryWithClassName:@"Place"];
    //[query whereKey:@"Location" nearGeoPoint:userGeoPoint withinMiles:10.0];
    [query whereKey:@"Location" nearGeoPoint:userGeoPoint];

    NSArray *placeObjects = [query findObjects];

    self.places = placeObjects;
    NSLog(@"%i",[self.places count]);

    UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background_texture.png"]];
    // self.tableView st
    self.view.backgroundColor = background;

    [background release];

    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [self.places count];
}

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

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    Place*p = [self.places objectAtIndex:indexPath.row];
    NSLog(@"%@",[self.places objectAtIndex:indexPath.row]);
    cell.textLabel.text = [NSString stringWithFormat:@"%@",p.name];
    cell.textLabel.textColor = [UIColor whiteColor];
    NSLog(@"%@",p);
    return cell;
}

/*
 // Override to support conditional editing of the table view.
 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
 {
 // Return NO if you do not want the specified item to be editable.
 return YES;
 }
 */

/*
 // Override to support editing the table view.
 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
 {
 if (editingStyle == UITableViewCellEditingStyleDelete) {
 // Delete the row from the data source
 [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
 }   
 else if (editingStyle == UITableViewCellEditingStyleInsert) {
 // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
 }   
 }
 */

/*
 // Override to support rearranging the table view.
 - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
 {
 }
 */

/*
 // Override to support conditional rearranging of the table view.
 - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
 {
 // Return NO if you do not want the item to be re-orderable.
 return YES;
 }
 */

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Navigation logic may go here. Create and push another view controller.
    /*
     <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
     // ...
     // Pass the selected object to the new view controller.
     [self.navigationController pushViewController:detailViewController animated:YES];
     [detailViewController release];
     */
}

@end
  • 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-02T06:33:41+00:00Added an answer on June 2, 2026 at 6:33 am

    You can use it with following

    NSString* strAddress = [[self.places objectAtIndex:indexPath.row]valueForKey:@"addressline1"];
    

    After giving indexPath.row use valueForKey: method to retrive value from the object. do it for all value and you will get it.

    To print in tableview write above code in CellForRowAtIndexPath

     NSString* strAddress = [[self.places objectAtIndex:indexPath.row]valueForKey:@"addressline1"];
     cell.textLabel.text = strAddress;
    

    Using this code all address1 data will show inside the tableview row

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

Sidebar

Related Questions

I have a pretty simple problem. Basically I have an array called $list that
I have a struct array called AnalysisResults , that may contain any MATLAB datatypes,
I have an array of objects in MATLAB and I've called their constructors in
I have an array of images loaded into a UIImageView that I am animating
I have an Array of MKAnnotation objects called arrAnnotations . I want to pick
I have an array of objects that I'd like to filter using a predicate,
I have an array called $times . It is a list of small numbers
I have an array of sprites called segments and I would like to skip
i am having a array called temparray and have 2 seperate arrays .i have
Specifically, I have an array of strings called val, and want to replace all

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.