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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:38:31+00:00 2026-06-12T10:38:31+00:00

I am having problems to get this work , I using core data to

  • 0

I am having problems to get this work , I using core data to fetch a list of User ,

NSFetchrequets to extra the user location , List of Places and Postcode

Image

NSFetchRequest *request =[NSFetchRequest fetchRequestWithEntityName:@"SiteLocation"]; //request all objects
NSArray *fetchedObjects = [self.srmDatabase.managedObjectContext executeFetchRequest:request error:nil];

So I have a Entity “SiteLocation” loading the tableview with FetchedResultController

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
     //NSLog(@"CELL");
    static NSString *CellIdentifier = @"Site Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    // Configure the cell...
    SiteLocation * siteLocation = [self.fetchedResultsController objectAtIndexPath:indexPath];
    cell.textLabel.text = siteLocation.siteName;

    return cell;
}

then I sent the selected row to the MapViewController didSelectRowAtIndexPath

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 {
   NSLog(@"didselect sitePC");

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {

    UserDetails *userinfo = [[self fetchedResultsController] objectAtIndexPath:indexPath];
    self.mapview.sitePC = userinfo; //sitePC is (id)
    NSLog(@"object selected= %@", userinfo);
} 
}

2012-10-04 13:27:46.401 SRMAB[459:c07] didselect sitePC = <SiteLocation: 0x1d80ad20> (entity: SiteLocation; id: 0x1d86b210 <x-coredata://523E1EB6-01DF-4889-B1A1-2E38E92D385E/SiteLocation/p120> ; data: {
    projectName =     (
        "0x1d82bc20 <x-coredata://523E1EB6-01DF-4889-B1A1-2E38E92D385E/UserDetails/p144>"
    );
    siteName = "Bloomberg Place 1";
    sitePostCode = "W1B 5AU";
})

On the MapViewController this will convert the sitePostcode to PlaceMark

-(void)myMapview
{
    NSLog(@"mymapview");

    NSString *addressString = [self.sitePC valueForKey:@"sitePostCode"];

    CLGeocoder *geocoder = [[CLGeocoder alloc] init];

    [geocoder geocodeAddressString:addressString completionHandler:^(NSArray *placemarks, NSError *anError)
     {
         NSLog(@"Placemark count:%d",[placemarks count]);

         for(CLPlacemark *placemark1 in placemarks)
         {
             NSLog(@"Placemark: %@",placemark1);
             //[self displayPlacemarks:placemarks];
             CLLocationCoordinate2D zoomLocation;
             zoomLocation.latitude = placemark1.location.coordinate.latitude;
             zoomLocation.longitude= placemark1.location.coordinate.longitude;

             MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 1000, 1000);
             MKCoordinateRegion adjustedRegion = [self.mapview regionThatFits:viewRegion];
             [self.mapview setRegion:adjustedRegion animated:YES];

             MKPointAnnotation *pa = [[MKPointAnnotation alloc] init];
             pa.coordinate = placemark1.location.coordinate;
             pa.title = [self.sitePC valueForKey:@"siteName"];
             [self.mapview addAnnotation:pa];
         }

I hope this make sense .

How can I Show all the location on the map when it loads ?

Question updated since the original question was a spelling mistake

  • 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-12T10:38:33+00:00Added an answer on June 12, 2026 at 10:38 am

    reason: '[<SiteLocation 0x1d80ad20> valueForUndefinedKey:]: the
    entity SiteLocation is not key value coding-compliant for the key
    "sitePostcode".'

    @”sitePostcode” is not the same as @”sitePostCode”. You use the former in your call to -valueForKey in -myMapView, but the picture of your Core Data model shows the latter.

    Update: To show a location on a map, you use a map annotation or overlay. For example, you can add a MKPinAnnotation to your map to indicate a position on the map. See Annotating Maps for more information. I see that you’re already using MKPointAnnotation, so it’s not clear what your question is. Perhaps you’re trying to show all the annotations at once — if that’s the problem, you’ll just need to calculate the rectangle that bounds all your locations and zoom the map to include that area.

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

Sidebar

Related Questions

Having big problems trying to get my php script to send email. Using this
Hello I am new at Haskell and i'm having problems trying to get this
I'm having some problems trying to get the code below to output the data
I'm having some problems getting the Friend List of a twitter user from R,
Below is the example code I'm using to get this to work and it
I'm having some problems trying to get a background upload system working using WebWorkers
I am having problem to get a numerical value for this expression where I
I've been having real problems trying to get a ruby script to run through
I am having problems with my MVC Routes. I am trying to get to
I am having many problems running DJ. Primarily, I cannot get delayed_job running any

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.