简体   繁体   English

XCode IBAction和IBOutlets错误

[英]XCode IBAction and IBOutlets errors

I'm having a bit trouble with my app and its really bothering me I was wondering if anyone could help me with IBOulets actions. 我在我的应用程序上遇到了一些麻烦,它确实困扰着我,我想知道是否有人可以通过IBOulets动作来帮助我。

I only see action and nothing else, it won't let me change it. 我只看到动作,没有别的,它不会让我改变它。

错误更新

any way to fix this issue. 任何解决此问题的方法。 Thanks for any help 谢谢你的帮助

If you drag your outlet between the @implementation UIViewControllerName and the @end (bottom section of the .m file) you create a IBAction (For example for button clicks) 如果将出口拖到@implementation UIViewControllerName和@end(.m文件的底部)之间,则会创建IBAction(例如,单击按钮)

If you drag your outlet between the @interface UIViewControllerName() and the @end before the @implementation, you create a IBOutlet. 如果在@interface UIViewControllerName()和@implementation之前的@end之间拖动插座,则会创建IBOutlet。 You can create it in the .h file and in the .m file. 您可以在.h文件和.m文件中创建它。 If there is no @interface in the .m file, you can create it. 如果.m文件中没有@interface,则可以创建它。 Add the following above the @implementation UIViewControllerName: 在@implementation UIViewControllerName上方添加以下内容:

@interface UIViewControllerName ()

// HERE YOU CAN DRAG YOUR IBOutlets

@end 

// Here begins the viewcontrollers implementation
@implementation UIViewControllerName

- (void) viewDidLoad {
..... etc. etc..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM