我在模拟器上成功运行了一个 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/