iphone - 应用程序在设备上运行时卡在特定 View 上

标签 iphone ios uibutton

我在模拟器上成功运行了一个 iPhone 应用程序,但是当我尝试在设备上运行它时,它停留在特定 View 上,我有一个表格 View ,其中包含带有按钮的自定义单元格。当我按下按钮超过四五次后,应用程序开始工作,我也检查了它的自动调整大小,我不知道为什么它在设备上不能正常工作,有什么帮助吗?

- (IBAction)didSelectCelebrityNameWithButton:(UIButton *)sender
{
CustomVC *customVC;
if(isFiltered)
    {
    NSLog(@"Celebrity Name : %i", sender.tag-1000);
     customVC = [filteredListResults objectAtIndex:sender.tag-1000];
    }
    else
    {
      customVC = [listResults objectAtIndex:sender.tag-1000];
    }
    if (customVC != nil)
    {
        if ([[NSUserDefaults standardUserDefaults] objectForKey:UD_FILTER_CELEBRITY_NAME])
        {
            [[NSUserDefaults standardUserDefaults] removeObjectForKey:UD_FILTER_CELEBRITY_NAME];
        }
        [[NSUserDefaults standardUserDefaults] setObject:customVC.celebrity_name forKey:UD_FILTER_CELEBRITY_NAME];
        [[NSUserDefaults standardUserDefaults] synchronize];

        RefinedCurrentSearchVC *refinedCurrentSearchVC = [[RefinedCurrentSearchVC alloc] initWithNibName:@"RefinedCurrentSearchVC_iPhone" bundle:nil];
        refinedCurrentSearchVC.isCelebrityFilter = YES;
        [self.navigationController pushViewController:refinedCurrentSearchVC animated:YES];
    }
}

我正在运行 xcode 4.6.2 并将其部署目标更改为 4.3 但问题仍然存在,

最佳答案

您的代码没有问题,只需从模拟器中删除您的应用程序,完全退出 xcode 并再次运行此应用程序,希望它能正常工作。

关于iphone - 应用程序在设备上运行时卡在特定 View 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18873234/

相关文章:

ios - objective-c - 标签中的多种颜色

iphone - 粘性搜索栏和部分标题行为类似于 native 联系人应用程序

iphone - 是否可以获取 UITableView 中单元格的所有索引路径的数组?

ios - 快速绘制一条全宽的虚线?

ios - 在 ios 7.1 中自定义按钮形状

ios - UIButton 选中状态改变图片

iOS : What is the need of register cell before dequeuing in UITableView?

ios - 选择了 unity xcode 模拟器但没有列出模拟器

ios - 设置 ImageView 的位置

ios - Swift 4.2 使用 UICollectionViewCell 添加/删除按钮