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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:29:24+00:00 2026-05-15T03:29:24+00:00

I do not understand why i am getting this error. Here is the related

  • 0

I do not understand why i am getting this error. Here is the related code:

Photo.h

#import <CoreData/CoreData.h>

@class Person;

@interface Photo :  NSManagedObject  
{
}

@property (nonatomic, retain) NSData * imageData;
@property (nonatomic, retain) NSNumber * Latitude;
@property (nonatomic, retain) NSString * ImageName;
@property (nonatomic, retain) NSString * ImagePath;
@property (nonatomic, retain) NSNumber * Longitude;
@property (nonatomic, retain) Person * PhotoToPerson;

@end

Photo.m

#import "Photo.h"

#import "Person.h"

@implementation Photo 

@dynamic imageData;
@dynamic Latitude;
@dynamic ImageName;
@dynamic ImagePath;
@dynamic Longitude;
@dynamic PhotoToPerson;

@end

This is a mapViewController.m class i have created. If i run this, the CLLocationDegrees CLLat and CLLong lines:

                CLLocationDegrees CLLat = (CLLocationDegrees)photo.Latitude;    
                CLLocationDegrees CLLong = (CLLocationDegrees)photo.Longitude;

give me the error : pointer value used where a floating point value was expected.

for(int i = 0; i < iPerson; i++)
        {
            //get the person that corresponds to the row indexPath that is currently being rendered and set the text
            Person * person = (Person *)[myArrayPerson objectAtIndex:i];
            //get the photos associated with the person
            NSArray * PhotoArray =  [person.PersonToPhoto allObjects];
            int iPhoto = [PhotoArray count];

        for(int j = 0; j < iPhoto; j++)
        {
            //get the first photo (all people will have atleast 1 photo, else they will not exist). Set the image
            Photo * photo = (Photo *)[PhotoArray objectAtIndex:j];

            if(photo.Latitude != nil && photo.Longitude != nil)
            {
                MyAnnotation *ann = [[MyAnnotation alloc] init];
                ann.title = photo.ImageName;
                ann.subtitle = photo.ImageName;

                CLLocationCoordinate2D cord;                    
                CLLocationDegrees CLLat = (CLLocationDegrees)photo.Latitude;    
                CLLocationDegrees CLLong = (CLLocationDegrees)photo.Longitude;

                cord.latitude = CLLat;
                cord.longitude = CLLong;

                ann.coordinate = cord;
                [mkMapView addAnnotation:ann];              

            }       
        }   
    }
  • 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-05-15T03:29:25+00:00Added an answer on May 15, 2026 at 3:29 am

    NSNumber is not a float type, but a pointer, so you need to do this to convert it:

    CLLocationDegrees CLLat = (CLLocationDegrees)[photo.Latitude doubleValue];    
    CLLocationDegrees CLLong = (CLLocationDegrees)[photo.Longitude doubleValue];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.