1

我将功能附加到按钮上,当我运行应用程序时,它工作得很好,但是当我单击按钮时,我的应用程序停止运行,我被提示返回 xcode。

我做错什么了吗?

我试图使用 IBAction 制作“下一个功能”,当我单击按钮时,它会将我的页面移动到另一个名为“关于我们”的应用页面。我使用了一些来自 youtube 的指南,并提出了如下编码;

视图控制器.h

@interface ViewController : UIViewController
{}
-(IBAction)next;

视图控制器.m

@implementation ViewController

-(IBAction)next;
{
    About_Us *AU = [[About_Us alloc] initWithNibName:nil bundle:nil];
    self.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentViewController:AU animated:NO completion:NO];
}

下面的代码上突出显示了一个绿色文本,上面写着“ Thread 1:breakpoint 3.1 4.1

About_Us *AU = [[About_Us alloc] initWithNibName:nil bundle:nil];

最近我使用的指南可能已经过时,因为 xcode 的版本已经升级,如果我能得到一些帮助会很好。

4

0 回答 0