【问题标题】:iOS5 problems with old applications旧应用程序的 iOS5 问题
【发布时间】:2011-10-27 08:25:47
【问题描述】:

我需要关于该怎么做的建议。

我在 App Store 上有几个应用程序,它们都经过测试并且功能齐全,适用于所有以前的 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 上运行良好,在 iOS5 上运行一次然后崩溃 10 次。

【问题讨论】:

  • 不幸的是,您别无选择,只能再次测试并纠正问题。找出问题的根源并解决它。它很可能不会在最终版本中得到修复。
  • 当我将一些淹没的地图划分为扇区时,我的所有应用程序在切换视图时都会出现问题。当我单击扇区时,它崩溃了。不知道如何解决这个问题:(
  • simpleBob 的评论 +1。根据提供的信息,很难看出问题可能是什么。这可能有用:msmvps.com/blogs/jon_skeet/archive/2010/08/29/…
  • 如果在测试期间出现问题,您应该提出错误报告——这就是测试版本的意义所在。您需要更具体地回答您的问题,然后才能获得良好的答复。代码在哪里崩溃?哪条线?

标签: iphone ipad ios5


【解决方案1】:

我发现对以前有效的 ivars 的引用现在需要引用为 self.ivar。也许您对 managedObjectContext 的引用应该改为 self.managedObjectContext?

【讨论】:

    【解决方案2】:

    我不太确定,但你也可以试试这个。

    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...
    

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

    【讨论】:

      【解决方案3】:

      好的,我设法找到解决方案。

      不知何故,iOS5 检测到一些 iOS4 中不存在的对象的发布,我试图找到它们但放弃了。

      我打开 ARC 并评论所有 release 和 dealloc,我的应用程序运行良好。我的印象是现在它的工作速度更快。希望这会对某人有所帮助...

      【讨论】:

        猜你喜欢
        • 2022-12-05
        • 1970-01-01
        • 1970-01-01
        • 2011-09-10
        • 1970-01-01
        • 2011-12-09
        • 2012-01-18
        • 2020-10-30
        • 2015-05-27
        相关资源
        最近更新 更多