UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame = CGRectMake(100, 100, 100, 40);
[btn setTitle:@"button" forState:UIControlStateNormal];
[btn setTitle:@"button01" forState:UIControlStateHighlighted];
btn.backgroundColor = [UIColor grayColor];
[btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
btn.titleLabel.font = [UIFont systemFontOfSize:18];
[btn addTarget:self action:@selector(pressBtn) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];