mac os開發NSButton


- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"Hello world!");
//    設置按鈕
    [self setbutton];
}
-(void)setbutton{
    NSButton *button = [[NSButton alloc]init];
    button.frame=CGRectMake(100, 100, 64, 64);
    [button setTitle:@"確認簽收"];
    [button setTarget:self];
    [button setAction:@selector(buttonClick)];
    [self.view addSubview:button];
}
-(void)buttonClick{
    NSLog(@"你點擊了切換模式");
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM