How to pass the value to the function when clicking on the UIButton
来源:互联网 发布:云计算的架构和类型 编辑:程序博客网 时间:2024/05/01 16:11
苹果开始时,当点击一个按钮,跳转到下一下页面,点击时,传递一个参数到调用方法
下面是老外的解释:
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 ....
- How to pass the value to the function when clicking on the UIButton
- HOW TO: remove the 300ms delay when clicking on a link in JQuery Mobile
- How to output the message when using the function 'printf'
- pass on to the entire
- Clicking the dock icon to show the app on Mac
- DataStage Certification - how to pass the exam
- How to pass a value from User Control to the Page
- How do my .NET-based clients get the app's HINSTANCE to pass to my function?
- how to disable the button when submitting
- How to pass the paramater of Node.js or io.js into native C/C++ function.
- How to pass the paramater of Node.js or io.js into native C/C++ function.
- How to detect when the client closes the connection?
- How to detect when the client closes the connection?
- How to use the function of assembly.
- How to get the data from a cell when I click on the GridButtonColumn of the same row
- How to chage the default opstion value when adding new products?
- how to intall stardict on the ubuntu
- How to enable the MPlayer on centOS7
- 1087. A Funny Game
- 修改VS2008(vc)中工程/解决方案/类的名字
- 快乐指南:程序员版
- SurfaceView显示Camera拍摄的画面
- “小苏有朋”马宁,一种解释不出的穿透力或杀伤力的视觉震憾
- How to pass the value to the function when clicking on the UIButton
- C++函数指针
- C# 鼠标拖放图片透明缩略图效果实现思路
- 1014. Specialized Four-Dig
- 如何防止代码腐烂
- 问题Re-installation failed due to different application signatures.解决
- perl: symbol lookup error: /usr/local/lib/libtdsodbc.so: undefined symbol: libiconv_open的解决办法
- 1007. To and Fro
- S3C6410启动模式介绍