簡體   English   中英

發行代碼的流向與調試不同嗎?

[英]Does release code flow differently from debug?

當我在設備發布模式下運行此代碼時,它會在“ [mapView setRegion:region animation:TRUE];”上拉出一個“ SIGABRT”。 線。 但是,無論在調試還是模擬器模式下,我都不會遇到問題。

我是xcode的新手。 我究竟做錯了什么?

- (void)initUI {
// add a map view in available area
startupPage = [[CSNet alloc] init];
positionUpdatePage = [[CSNet alloc] init];
opponentsPage = [[CSNet alloc] init];
firePage = [[CSNet alloc] init];
checkinPage = [[CSNet alloc] init];
[self getStartup:FALSE];
UIImage *blueButton = [[UIImage imageNamed:@"blueButton.png"] stretchableImageWithLeftCapWidth:12.0f topCapHeight:0.0f];
UIImage *redButton = [[UIImage imageNamed:@"redButton.png"] stretchableImageWithLeftCapWidth:12.0f topCapHeight:0.0f];
UIImage *gpsImage = [UIImage imageNamed:@"gps_icon.png"];
[self initSounds];
[gpsButton setBackgroundImage:gpsImage forState:UIControlStateNormal];
[settingsButton setBackgroundImage:blueButton forState:UIControlStateNormal];
[joinButton setBackgroundImage:blueButton forState:UIControlStateNormal];
[fireButton setBackgroundImage:redButton forState:UIControlStateNormal];
[self UpdateIndicators];
MKCoordinateRegion region;
region.span.latitudeDelta = [appDelegate.savedSpanLatitude floatValue];
region.center.latitude = [appDelegate.savedLatitude floatValue];
region.center.longitude = [appDelegate.savedLongitude floatValue];
mapHeight = self.view.frame.size.height; // - 50;
mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, mapHeight)];
// viewtouch catches events on map
viewTouch = [[CSViewTouch alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, mapHeight)];
viewTouch.multipleTouchEnabled = TRUE;
[self.view insertSubview:mapView atIndex:0];
[mapView setDelegate:self];
mapType.selectedSegmentIndex = [appDelegate.savedMapViewType intValue];
[mapView setRegion:region animated:TRUE];

您從未在上面的代碼中設置region.span.longitudeDelta。 我建議使用MKCoordinateRegionMake函數設置兩個值和兩個增量,因此您最終不會出現陳舊或隨機值。

傑森(Jason)的評論准確而有用-如果可能,我會“檢查”該評論。 我的發布代碼的行為有所不同。 一旦查看了堆棧(感謝提示,Jason),我就意識到將mapView設置為longitudeDelta為0時的代碼錯誤。此行為不僅在調試/發行版與設備/模擬器之間似乎有所不同,而且顯然是裁剪的在最新的iPhone OS中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM