objective-c做ipad程序修改UILabel的text属性没有改掉文本
#import<UIKit/UIKit.h>@interfaceViewController:UIViewController{IBOutletUILabel*lable...
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
IBOutlet UILabel* lable;
IBOutlet UIButton* button;
IBOutlet UITextField* textbox;
}
@property(nonatomic,retain)UILabel* lable;
@property(nonatomic,retain)UIButton* button;
@property(nonatomic,retain)UITextField* textbox;
- (IBAction)setButtonClick:(id)sender;
@end
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)viewDidUnload
{
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation==UIInterfaceOrientationLandscapeRight);
}
- (IBAction)setButtonClick:(id)sender{
lable.text=@"";
//textbox.text=@"";
return;
}
@end 展开
@interface ViewController : UIViewController
{
IBOutlet UILabel* lable;
IBOutlet UIButton* button;
IBOutlet UITextField* textbox;
}
@property(nonatomic,retain)UILabel* lable;
@property(nonatomic,retain)UIButton* button;
@property(nonatomic,retain)UITextField* textbox;
- (IBAction)setButtonClick:(id)sender;
@end
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)viewDidUnload
{
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation==UIInterfaceOrientationLandscapeRight);
}
- (IBAction)setButtonClick:(id)sender{
lable.text=@"";
//textbox.text=@"";
return;
}
@end 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询