error77
asked on
Iphone SDK Button Click Go to View
Hi all,
I have an app (iphone) and on a view I already have a button and an action applied to it.
Right now, when you click the button an Alert message will show up.
Basically I just want to remove the Alert message code and replace it with some code that will link to a UIView.
How can I do that please?
THanks
I have an app (iphone) and on a view I already have a button and an action applied to it.
Right now, when you click the button an Alert message will show up.
Basically I just want to remove the Alert message code and replace it with some code that will link to a UIView.
How can I do that please?
THanks
ASKER
So if I was to use something like this on it's own:
[self.view addSubview:MyView];
would that work on it's own?
I find it really hard to do things the mac way.
On interface builder it would be great to add your buttons, then double click on the button and enter the code just there...
Just like every piece of software I've ever worked for. :o/
[self.view addSubview:MyView];
would that work on it's own?
I find it really hard to do things the mac way.
On interface builder it would be great to add your buttons, then double click on the button and enter the code just there...
Just like every piece of software I've ever worked for. :o/
Hello,
You want to switch from one view to another on click of the button.So you will need to create two views one will be displayed and one will be added as an subview on click of the button ie at IBAction
Regards
Hemant
You want to switch from one view to another on click of the button.So you will need to create two views one will be displayed and one will be added as an subview on click of the button ie at IBAction
Regards
Hemant
ASKER
So the totally minimum code involved would be:
1. create 2 views
2. Add the buttons to the views on IB
3. add the IBAction to the .h files
4. add the IBAction code to the .m file with the [self.view addSubview:MyView2]; in it.
5. link the buttons to the IBAction actions?
1. create 2 views
2. Add the buttons to the views on IB
3. add the IBAction to the .h files
4. add the IBAction code to the .m file with the [self.view addSubview:MyView2]; in it.
5. link the buttons to the IBAction actions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great! THanks
Example code :
In the following code i have two view one is login and another is forgot password.
on click of forgot password button i am performing following action
1)Remove login view from superview
2) Adding sub view as new forgot password view in the same view.
-(IBAction)onForgot:(id)se
{
[loginView removeFromSuperview];
forgotPasswordView.backgro
[forgotPasswordEmailTextFi
[self.view addSubview:forgotPasswordV
}
If you want any other help tell me i am available.
Regards ,
Hemant