苹果开始时,当点击一个按钮,跳转到下一下页面,点击时,传递一个参数到调用方法
下面是老外的解释:
Hi all,
NSString *name = @"John";
I need to pass the above variable value, when clicking on the uibutton
currently i created the uibutton like below
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];
when i clicking the above button, it calls the method but i want to pass the variable (name) to the function...
Please guide me to get it ....
NSString *name = @"John";
I need to pass the above variable value, when clicking on the uibutton
currently i created the uibutton like below
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];
when i clicking the above button, it calls the method but i want to pass the variable (name) to the function...
Please guide me to get it ....