Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Keeping the actions effects after leaving the view
Hello guys, I have an issue, i have an application does have 2 views for example. The First view with webview , And the second have actions in it and labels connected to the actions.
What happens to me right now is when someone leave the first view and go to the second and do some actions in it(so the labels.text changes) then he go to the first view , then he goes back to the second, the second view goes back to its default mode
Is there a CODE to insure that the view WOULD NOT go back to its default mode after it had modified from the actions?
by the way:the transition way from the first view to the second is Partial Curl
Hello guys, I have an issue, i have an application does have 2 views for example. The First view with webview , And the second have actions in it and labels connected to the actions.
What happens to me right now is when someone leave the first view and go to the second and do some actions in it(so the labels.text changes) then he go to the first view , then he goes back to the second, the second view goes back to its default mode
Is there a CODE to insure that the view WOULD NOT go back to its default mode after it had modified from the actions?
by the way:the transition way from the first view to the second is Partial Curl
Thanks SDT
Views are not a place to store data. They are a place to DISPLAY data.
Any time you leave a view controller, it's views can get unloaded. In storyboard, the default is to deallocate the whole view controller.
What you want to do is to create instance variables that store the information that you want to display, and then copy that information to your views in your viewWillAppear method.
If you are using storyboard and creating a new view controller each time, you need a data container of some sort to hold state information. You can create a data container for each view controller, or you can create a data container singleton that saves state information for your whole app, and put your state data there.
Regards,
Duncan C WareTo
Animated GIF created with Face Dancer, available for free in the app store.
Views are not a place to store data. They are a place to DISPLAY data.
Any time you leave a view controller, it's views can get unloaded. In storyboard, the default is to deallocate the whole view controller.
What you want to do is to create instance variables that store the information that you want to display, and then copy that information to your views in your viewWillAppear method.
If you are using storyboard and creating a new view controller each time, you need a data container of some sort to hold state information. You can create a data container for each view controller, or you can create a data container singleton that saves state information for your whole app, and put your state data there.
Thank you Mr.Duncan C
now I understand !
ok
Can you show me please how to hold state information in a data container
It depends on the data and how it is showed. If you display text in labels you'll need to store those strings, if it's an image, you need to save the image (or remember its filename if it's already saved), if you can reposition elements and you want to restore that, you need to save the positions and sizes of those elements (CGRect).
It depends on the data and how it is showed. If you display text in labels you'll need to store those strings, if it's an image, you need to save the image (or remember its filename if it's already saved), if you can reposition elements and you want to restore that, you need to save the positions and sizes of those elements (CGRect).
Can you ِExplain it to me Please And if you gave me some links and resources that explain what you meant (and what I need) I will be thankful to you Regards
Replies
Any time you leave a view controller, it's views can get unloaded. In storyboard, the default is to deallocate the whole view controller.
What you want to do is to create instance variables that store the information that you want to display, and then copy that information to your views in your viewWillAppear method.
If you are using storyboard and creating a new view controller each time, you need a data container of some sort to hold state information. You can create a data container for each view controller, or you can create a data container singleton that saves state information for your whole app, and put your state data there.
Duncan C
WareTo
Animated GIF created with Face Dancer, available for free in the app store.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomenow I understand !
ok
Can you show me please how to hold state information in a data container
either for each view or for the whole app?
Thanks again Sir
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThe data that i want it to be displayed the second view is integers to be exact.
This is the Action I use in the second view
-(IBAction)calc:(id)sender{
int res1 = num1.text.intValue - num2.text.intValue;
if (res1 <0) {
eq1.text = [NSString stringWithFormat:@\"%i\", res1];
}else{
eq1.text = @\"\"
}
}
I don't know what do you mean when you said Can you ِExplain it to me Please
And if you gave me some links and resources that explain what you meant (and what I need) I will be thankful to you
Regards
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeOk can you give me an example project with 2 view and action in the second please
and tell me where did you make changes
I will be grateful to you sir
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome