Developer/iOS

[IPhone]코드로 버튼 추가하기.

블로blow 2011. 3. 21. 11:23
728x90


- (void)viewDidLoad {

    [super viewDidLoad];

UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[button setFrame:CGRectMake(0.0f, 0.0f, 80.0f, 30.0f)];

[button setCenter:CGPointMake(160.0f, 208.0f)];

[button setTitle:@"Beep" forState:UIControlStateNormal];

  [button addTarget:self action:@selector(playSound)

forControlEvents:UIControlEventTouchUpInside];

[self.view addSubview:button];

}


-(void)playSound

{

NSLog(@"소리나게 하는 소스 추가");

}

728x90