2011-04-14 113 views
1

我已安装该应用程序。在ios 4.2中,地图是完整的工作,但这个应用程序崩溃在ios 3.2。 我能做些什么?UIMapkit实施问题

导入 “customAnnotation.h”

@implementation customAnnotation @synthesize坐标,titletext,subtitletext;

- (ID)initWithCoordinate:(CLLocationCoordinate2D)COORDS {

coordinate = coords; 
NSLog(@"%f,%f",coords.latitude,coords.longitude); 
return self; 

}

  • (的NSString *)字幕{ 返回self.subtitletext; }
  • (NSString *)title { return self.titletext; }

- (无效)的setTitle:(的NSString *)strTitle {
self.titletext = strTitle;
}

- (无效)setSubTitle:(的NSString *)strSubTitle {
self.subtitletext = strSubTitle;
}
- (void)dealloc {titletext release]; [subtitletext release]; [super dealloc];

}

@end

定制的注释类

和其他类代码是在这里

进口 “MapExampleViewController.h”

@implementation MapExampleViewController

- (无效)C reateAnnotationWithCoords:(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]; 

}

//实施viewDidLoad中加载视图后做额外的设置,通常从笔尖。 - (无效)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] sharedlibrary应用负载规则所有 继续 程序接收到的信号:“EXC_BAD_ACCESS”。 警告:check_safe_call:无法恢复当前帧

警告:check_safe_call:无法恢复当前帧

警告:无法恢复先前选择的帧。 警告:check_safe_call:无法恢复当前帧

警告:无法恢复先前选定的帧。 警告:无法恢复先前选定的帧。 警告:无法恢复先前选定的帧。 (gdb) 请帮忙! 谢谢

+0

发布崩溃日志和相关代码... – Jhaliya 2011-04-14 14:21:06

+0

从设备添加日志。 – 2011-04-14 14:21:29

回答

0

检查您是否使用了某些在3.2操作系统中无法使用的功能,例如在OS4.0中引入了地图叠加...