2

我正在开发一个 iPad 应用程序,该应用程序仅在 sqlite 数据库中有某些数据时才启动初始屏幕,如下所示:

if ((int)[MyStore sharedInstance].mode < 0) 
{
    self.connectionSettingsViewController = [[[ConnectionSettingsViewController alloc] initWithNibName:@"ConnectionSettingsModalViewController" bundle:nil] autorelease];
    self.connectionSettingsViewController.view.transform = CGAffineTransformMakeRotation(M_PI_2); 
    self.connectionSettingsViewController.delegate = self;
    self.launchScreen = [[[UIView alloc] initWithFrame:CGRectMake(-256, 0, 1024, 768)] autorelease];
    [self.launchScreen addSubview:self.connectionSettingsViewController.view];
    [self.window addSubview:self.launchScreen];
}

该代码在应用程序委托中。我面临的问题是这在 iOS 模拟器中运行良好,但是当我尝试在 iPad 上运行时,出现以下错误:

[someViewController copyWithZone:] unrecognized selector sent to instance.
4

1 回答 1

-1

UIViewController 没有实现 NSCopying 协议。除非您在自己的 UIViewController 子类中实现了 NSCopying,否则您的视图控制器不会响应-copyWithZone:.

于 2011-12-16T21:09:20.953 回答