UIMapkit实施问题
|
我已经安装了应用程序。在ios 4.2中,地图可以正常工作,但是此应用在ios 3.2中崩溃。
我能做什么?
#import \"customAnnotation.h\"
@implementation customAnnotation
@synthesize coordinate, titletext, subtitletext;
-(id)initWithCoordinate:(CLLocationCoordinate2D)coords{
coordinate = coords;
NSLog(@\"%f,%f\",coords.latitude,coords.longitude);
return self;
}
- (NSString *)subtitle{
return self.subtitletext;
}
- (NSString *)title{
return self.titletext;
}
-(void)setTitle:(NSString*)strTitle {
self.titletext = strTitle;
}
-(void)setSubTitle:(NSString*)strSubTitle {
self.subtitletext = strSubTitle;
}
-(void)dealloc {
[titletext release];
[subtitletext release];
[super dealloc];
}
@end
in custom annotation class
and other class code is here
#import \"MapExampleViewController.h\"
@implementation MapExampleViewController
-(void)createAnnotationWithCoords:(CLLocationCoordinate2D)coords{
customAnnotation *annotation = [[customAnnotation alloc] initWithCoordinate:coords];
//annotation.title = @\"Gandhinagar\";
//annotation.subtitle = @\"Indroda Park\";
[annotation setTitle:@\"Main Title\"];
[annotation setSubTitle:@\"Sub Title\"];
[myMapView addAnnotation:annotation];
[annotation release];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
myMapView = [[MKMapView alloc] initWithFrame:[self.view bounds]];
CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(23.216667, 72.683333);
float zoomLevel = 0.2;
MKCoordinateRegion region = MKCoordinateRegionMake(coords, MKCoordinateSpanMake(zoomLevel, zoomLevel));
[myMapView setRegion:[myMapView regionThatFits:region] animated:YES];
myMapView.delegate = self;
[self createAnnotationWithCoords:coords];
[self.view addSubview:myMapView];
}
当我安装应用程序时。在iOS 3.2中,然后给出以下错误
[切换到线程11779]
[切换到线程11779]
共享库Apply-load-rules全部
继续
程序接收信号:“ EXC_BAD_ACCESS”。
警告:check_safe_call:无法恢复当前帧
警告:check_safe_call:无法恢复当前帧
警告:无法恢复先前选择的框架。
警告:check_safe_call:无法恢复当前帧
警告:无法恢复先前选择的框架。
警告:无法恢复先前选择的框架。
警告:无法恢复先前选择的框架。
杀
放弃
调试器已退出,状态为0。(gdb)
请帮忙!
谢谢
没有找到相关结果
已邀请:
1 个回复
诉嘎归亮