Как решить CALayerInvalidGeometry', причина :'Позиция CALayer содержит NaN :[nan nan]?

У меня есть ошибка, из-за которой происходит сбой приложения при его запуске. Это ошибка, которую я получил:

*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'
*** First throw call stack:
(0x250b022 0x2709cd6 0x24b3a48 0x24b39b9 0x217ec0d 0x2174f55 0x158f3f7 0xbc74e 0xbe512 0xbfa26 0xbe4ad 0x224ffda 0x224f956 0x224e449 0x224ab9a 0x24df970 0x247f1c1 0x2442967 0x2441d84 0x2441c9b 0x2c0a7d8 0x2c0a88a 0x1559626 0x2aed 0x2a65)
terminate called throwing an exception

я пытался использовать точку останова исключения, и она не показывает, какая часть кода пошла не так. Она останавливается только в этой точке -0xbc74e :movl $0, %eax-

Как я могу это решить? Пожалуйста помоги.

*редактировать

Я нашел часть, которая вызывает исключение, но я не вижу, что не так

- (void)viewDidLoad {
[super viewDidLoad];
[self.activityView startAnimating];
self.mapView.layerDelegate = self;
self.mapView.touchDelegate = self;
self.mapView.calloutDelegate = self;

NSURL *mapUrl = [NSURL URLWithString:kTiledMapServiceURL];
AGSTiledMapServiceLayer *tiledLyr = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:mapUrl];
[self.mapView addMapLayer:tiledLyr withName:@"Tiled Layer"];
       .
       .
       .
}
- (void)mapViewDidLoad:(AGSMapView *)mapView {

AGSEnvelope *envelope = [[AGSEnvelope alloc]initWithXmin:29757.610204117 ymin:40055.0379682464 xmax:29884.6992302249 ymax:40236.6028660071 spatialReference:self.mapView.spatialReference];

//call method to set extent, pass in envelope
[self.mapView zoomToEnvelope:envelope animated:YES];

self.mapView.callout.width = 195.0f;
self.mapView.callout.accessoryButtonHidden = YES;

[self.mapView.gps start];
[self.mapView centerAtPoint:self.mapView.gps.currentPoint animated:YES];  

[self.activityView stopAnimating];
self.activityView.hidden = YES;

}

Эта строка вызывает ошибку self.mapView.layerDelegate = self;, которая по умолчанию вызывает методmapViewDidLoad

15
задан sihao 13 August 2012 в 09:02
поделиться