按下后隐藏 UI 按钮
嘿! 我试图在按下 UIButton 后隐藏它
这是我的 .h 代码:
#import <UIKit/UIKit.h>
@interface TemplateTestViewController : UIViewController { }
- (IBAction)ButtonPressed;
IBOutlet UIButton *sample; @property (nonatomic, retain) IBOutlet UIButton
*sample;
@end
这是我的 .m 代码:
#import "TemplateTestViewController.h"
#import "Page.h"
@implementation TemplateTestViewController
@synthesize sample;
-(IBAction) ButtonPressed{
if ( ([sample.selected=YES]))
{
sample.hidden = YES;
}
我收到四个错误,并且代码不起作用。我做错了什么?我是新来的,所以一些示例代码将不胜感激!
Hey!
I am trying to hide a UIButton after it is pressed
This is my .h code:
#import <UIKit/UIKit.h>
@interface TemplateTestViewController : UIViewController { }
- (IBAction)ButtonPressed;
IBOutlet UIButton *sample; @property (nonatomic, retain) IBOutlet UIButton
*sample;
@end
This is my .m code:
#import "TemplateTestViewController.h"
#import "Page.h"
@implementation TemplateTestViewController
@synthesize sample;
-(IBAction) ButtonPressed{
if ( ([sample.selected=YES]))
{
sample.hidden = YES;
}
I get four errors and the code does not work. What am I doing wrong? I am new so some sample code would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 .h 文件中存在带有 @interface 声明的问题。在下面使用
并在您的 .m 类中
you have issue in the your .h file with @interface declaration. use below
And in your .m class