NSString *name = @"John";
我需要通過上面的變量值,當點擊uibutton。目前,我創建了UIButton的象下面這樣:如何在點擊UI按鈕時將值發送到函數
sendButton = [[UIButton alloc] initWithFrame:CGRectMake(170, 350, 90, 30)];
[sendButton setTitle:@"YES!" forState:UIControlStateNormal];
[sendButton addTarget:self action:@selector(sendAlert forControlEvents:UIControlEventTouchUpInside];
[sendButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
sendButton.backgroundColor = [UIColor whiteColor];
[popoverView addSubview:sendButton];
[sendButton release];
當我點擊上面的按鈕,它會調用該方法,但我想通過變量(名稱)的功能...
請指引我得到它....
Hi..Thnks您time..is這將參數傳遞給函數 – iPhonegal 2010-10-29 13:23:58