2011-10-27 46 views
0

我需要建議做些什麼。舊應用程序的iOS5問題

我在應用程序商店有幾個應用程序,它們都經過測試,並且適用於所有以前的iOS。但是現在當我更新我的設備到iOS5時,他們中的一些人開始突然崩潰在要求連接到互聯網並顯示當前位置的地圖的警報視圖項目上。

我不是那麼有經驗的開發,所以需要一些建議做什麼?我認爲,在iOS5的最終版本中,這些東西將被自己修復或不修復。

謝謝。

好的,我已經打了殭屍,並找到了問題的方法。

- (void) alertView: (UIAlertView*) alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{ 
    NSLog(@" Button PRESSED: %d", buttonIndex); 
    [alertView release]; 



    if (buttonIndex == 1) { 
     BOOL noConnectionAvailable = NO; 
     BOOL hasParentalLimit = NO; 

     switch (lastSelectedItem.itemType) { 
      case RestaurantItemTypeAddress : { 
       if ([NetworkHelper connectedToNetwork] == YES) { 
        AddressController *mapController = [[AddressController alloc] initWithNibName:@"AddressController" bundle:nil restaurant:restaurant]; 
        mapController.title = restaurant.res_title; 
        [self.navigationController pushViewController:mapController animated:YES]; 
        [mapController release]; 
       } else 
        noConnectionAvailable = YES; 

       break; 
      } 
      case RestaurantItemTypeReservationEmail : { 
       if ([NetworkHelper connectedToNetwork] == YES) { 
        MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; 
        picker.mailComposeDelegate = self; 

        [picker setSubject:@"Reservation"]; 
        // Set up recipients 
        NSArray *toRecipients = [NSArray arrayWithObject:lastSelectedItem.itemTextContent];    
        [picker setToRecipients:toRecipients]; 

        // Fill out the email body text 
        NSString *emailBody = @""; 
        [picker setMessageBody:emailBody isHTML:NO]; 

        [self presentModalViewController:picker animated:YES]; 
        [picker release]; 

        [self.tableView deselectRowAtIndexPath:lastSelectedIndexPath animated:YES]; 
       } else 
        noConnectionAvailable = YES; 

       break; 
      } 
      case RestaurantItemTypeReservationForm : { 
       if ([NetworkHelper connectedToNetwork] == YES) { 
        if ([NetworkHelper canOpenUrl:lastSelectedItem.itemTextContent]) { 
         WebViewController *wvc = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil urlStr:lastSelectedItem.itemTextContent]; 
         wvc.title = restaurant.res_title; 
         [self.navigationController pushViewController:wvc animated:YES]; 
         [wvc release]; 
        } else hasParentalLimit = YES; 
       } else 
        noConnectionAvailable = YES; 

       break; 
      } 
      case RestaurantItemTypeWeb : { 
       if ([NetworkHelper connectedToNetwork] == YES) { 
        if ([NetworkHelper canOpenUrl:lastSelectedItem.itemTextContent]) { 
         WebViewController *wvc = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil urlStr:lastSelectedItem.itemText]; 
         wvc.title = restaurant.res_title; 
         [self.navigationController pushViewController:wvc animated:YES]; 
         [wvc release]; 
        } else hasParentalLimit = YES; 
       } else 
        noConnectionAvailable = YES; 

       break; 
      } 

     } 

     if (noConnectionAvailable == YES) { 
      UIAlertView* newAlert = [[UIAlertView alloc] initWithTitle:@"Jesolo Official Guide" 
                   message:@"Nessuna connessione disponibile." 
                   delegate:self 
                cancelButtonTitle:@"OK" 
                otherButtonTitles:nil]; 
      [newAlert show]; 
     } 

     if (hasParentalLimit == YES) { 
      UIAlertView* newAlert = [[UIAlertView alloc] initWithTitle:@"Jesolo Official Guide" 
                   message:@"Navigazione su Web non consentita." 
                   delegate:self 
                cancelButtonTitle:@"OK" 
                otherButtonTitles:nil]; 
      [newAlert show]; 

     } 

    } 

    [self.tableView deselectRowAtIndexPath:lastSelectedIndexPath animated:NO]; 

} 

日誌在iOS4和iOS5上不同。 在iOS5中也說:

2011-11-04 16:26:28.550 Jesolo-EN[5693:207] Button PRESSED: 1 
2011-11-04 16:26:28.776 Jesolo-EN[5693:207] *** -[NSIndexPath isEqual:]: message sent to deallocated instance 0xe6b6fc0 
sharedlibrary apply-load-rules all 
Current language: auto; currently objective-c 
warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame. 
(gdb) 

和iOS4的說:

2011-11-04 16:28:08.087 Jesolo-EN[5859:207] Button PRESSED: 1 
2011-11-04 16:28:08.162 Jesolo-EN[5859:207] *** -[UIAlertView release]: message sent to deallocated instance 0x78c4940 
sharedlibrary apply-load-rules all 
Current language: auto; currently objective-c 
(gdb) 

我明白,我發佈數據之前我使用它們,但是當我沒有啓用殭屍運行的應用程序它的iOS4和做工精細它運行一次,然後10次崩潰。

+3

不幸的是,你沒有別的選擇,只能再次測試和糾正問題。找到問題的起源和解決辦法。它很可能不會在最終版本中修復。 – Daniel

+0

當我按部門劃分一些淹沒地圖時,我的所有應用程序在切換視圖時遇到問題。當我點擊扇區時,它崩潰。不知道如何解決這個問題:( – Akosha

+0

+1對於simpleBob的評論,並且提供的信息,很難看出問題可能是什麼,這可能是有用的:http://msmvps.com/blogs /jon_skeet/archive/2010/08/29/writing-the-perfect-question.aspx – occulus

回答

0

我發現到的ivars引用以前工作現在需要被引用爲self.ivar。也許你對managedObjectContext的引用應該改爲self.managedObjectContext?

0

我不是很肯定這一點,但你可以試試這個也..

Click on your **project**->go to **info**-> go to **build** section-> in that go to **Deployment** section->then **IOS deployment** section choose the **deployment target to IOS 5** or latest and save and run... 

希望它可以幫助你... :)

0

好吧我設法找到解決方案。

不知何故,iOS5檢測到一些iOS4中不存在的對象的釋放,我試圖找到它們,但放棄了。

取而代之的是,我打開ARC並評論所有版本和dealloc,我的應用程序做得非常好。我的印象是,現在它運行得更快。希望這可以幫助別人...