I am trying to add an annotation from property list. I found a solution here:
but it gives me an error "use of undeclared identifier "racks"" and "use of undeclared identifier "GetRacks"" here:
// Add annotations
NSArray *bikePath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *bikeDocumentsDirectory = [bikePath objectAtIndex:0];
NSString *path = [bikeDocumentsDirectory stringByAppendingPathComponent:@"data.plist"];
NSDictionary* bikesDictionary = [[NSDictionary alloc] initWithContentsOfFile:path];
GetRacks racks = [[GetRacks alloc] initWithDictionary:bikesDictionary];
for(RackAnnotation *rackAnnotation in [racks getRacks])
{
[mapView addAnnotation:rackAnnotation];
}
Can anybody help me with this?
You do not initialize
when racks is not a pointer.
is gonna work just fine!
EDIT: change this:
to this: