小编Ale*_*y V的帖子

MKMapView上的rightCalloutAccessoryView未显示

我的iphone应用程序没什么问题.我有这样的类和接口:

CinemaMapAnnotation.h

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>

@interface CinemaMapAnnotation : NSObject <MKAnnotation>{
    CLLocationCoordinate2D coordinate;
    NSString *title;
    NSString *subtitle;

}

@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
@property (nonatomic, copy) NSString* title;
@property (nonatomic, copy) NSString* subtitle;

-(id)initWithCoordinate:(CLLocationCoordinate2D) c;

@end
Run Code Online (Sandbox Code Playgroud)

CinemaMapAnnotation.m

#import "CinemaMapAnnotation.h"

@implementation CinemaMapAnnotation

@synthesize title, subtitle, coordinate;

-(id)initWithCoordinate:(CLLocationCoordinate2D) c{
    self = [super init];
    if (self) {
        coordinate = c;
    }
    return self;
}

-(void) dealloc {
    self.title = nil;
    self.subtitle = nil;
    [super dealloc];
}


@end
Run Code Online (Sandbox Code Playgroud)

CinemasMapController.h

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c mkmapview ios

4
推荐指数
1
解决办法
5094
查看次数

标签 统计

ios ×1

iphone ×1

mkmapview ×1

objective-c ×1