嗨,我是iphone applixcation开发的新手,请让我知道如何将2个参数传递给登录按钮我想在按钮点击登录按钮时传递用户名和密码.我是以这种方式给出的
-(IBAction)Login_Method:(id)sender withpassword:(id)password
{
}
Run Code Online (Sandbox Code Playgroud)
无法在IBAction方法中发送2个参数.
您可以做的是创建2个插座,然后将它们连接到密码和用户名文本字段.在单击登录按钮时,从上述2个插座中读取文本值.
您的登录按钮操作方法将是这样的
//username and password are UITextfields
-(IBAction)Login_Method:(id)sender
{
id name=[username text];
id pass=[password text];
}
Run Code Online (Sandbox Code Playgroud)