【发布时间】:2016-05-31 22:27:51
【问题描述】:
我正在 Xcode 7.2 中开发一个 iPhone 应用程序没有情节提要。
这是我的第一个屏幕。
我拿了一个 UIButton,把它连接到方法上。
但是我的方法没有被调用。
下面是我的 AppDelegate 代码。
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[ViewController alloc]
initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
//[self.window addSubview:self.viewController.view];
[self.window makeKeyAndVisible];
我的按钮点击事件:
- (IBAction)loginButton:(id)sender
{
NSLog(@"Hello world");
}
【问题讨论】:
-
你能分享创建按钮的代码
-
我正在将连接从我的按钮拖到代码中,内部进行了修饰。
-
请发布无效的代码
-
- (IBAction)loginButton:(id)sender{ NSLog(@"Hello world"); }
-
在登录按钮上点击鼠标右键,进行屏幕显示,需要查看它是否正确连接到文件所有者。
标签: ios objective-c xcode xib