Mapkit实施问题

问题描述 投票:1回答:1

我已安装该应用程序。在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] sharedlibrary apply-load-rules all continue程序接收信号:“EXC_BAD_ACCESS”。警告:check_safe_call:无法恢复当前帧

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

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

警告:无法恢复以前选择的帧。警告:无法恢复以前选择的帧。警告:无法恢复以前选择的帧。杀死了

调试器已退出状态0.(gdb)请帮忙!谢谢

iphone objective-c ios4 iphone-sdk-3.0
1个回答
0
投票

检查您是否使用了3.2 OS中没有的某些功能,例如OS4.0中引入了地图叠加...

© www.soinside.com 2019 - 2024. All rights reserved.