I have built up an array of objects, created from a class, I wrote before. I just wanted to access some of the class variables while looping through the array:
- (void)viewDidLoad
{
[super viewDidLoad];
NSMutableArray *medicalCenters = [(AppDelegate *)[[UIApplication sharedApplication] delegate] medicalCenters];
for (MedicalCenter *row in medicalCenters){
NSString *latitude = row.MCLatitude;
NSLog(@"%@", latitude);
}
}
the Class File I've created look like this:
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface MedicalCenter : NSObject
{
CLLocationCoordinate2D _coordinate;
}
@property (nonatomic, strong) NSString *medicalCenter;
@property (nonatomic, assign) NSString *MCLatitude;
@property (nonatomic, assign) NSString *MCLongitude;
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
- (id)initWithName:(NSString *)medicalCenter coordinate:(CLLocationCoordinate2D)coordinate;
@end
Whenever I built up the NSString *latitude = row.MCLatitude, I got the message:
Bad_excess Code:1
But when I just list the objects in the array medicalCenters, I can see them all............ Did I miss something important?
Thanks Sebastian
assignforMCLatitudeandMCLongitude?