Trying to do two things:
When I add the line break \n, all it does is stop any text after to show. So it just shows "Name of Branch" (see below) and then nothing else. I'm looking for the absolute easiest implementation.
"VBAnnotation.h" file:
@interface VBAnnotation : NSObject <MKAnnotation>
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *subtitle;
- initWithPosition:(CLLocationCoordinate2D)coords;
@end
"VBAnnotation.m" file:
#import "VBAnnotation.h"
@implementation VBAnnotation
@synthesize coordinate;
@synthesize title;
@synthesize subtitle;
- initWithPosition:(CLLocationCoordinate2D)coords {
if (self = [super init]) {
self.coordinate = coords;
}
return self;
}
@end
In my ViewController:
CLLocationCoordinate2D walnut;
walnut.latitude = WALNUT_LATITUDE;
walnut.longitude = WALNUT_LONGITUDE;
VBAnnotation *branch = [[VBAnnotation alloc] initWithPosition:walnut];
[branch setCoordinate:walnut];
branch.title = @"Name of Branch \n More Info on Branch"; ### adding line break
branch.subtitle = @"This is where the address will go";
branch.customTitle = @"Another custom title to "; ### is this possible?
[self.mapView addAnnotation:branch];