I am using iOS image gallery for selecting the image in my code
When I have done selecting image it calls the viewWillAppear method of my current class in which I have clear some variable.
So it clear the variable again which I not want.
Is there any method when the image gallery close it not calls the viewWillAppear method.
Thanks
Asked
Active
Viewed 918 times
1

Manish Agrawal
- 10,958
- 6
- 44
- 76
2 Answers
4
The problem here is your architecture and not the way the UIView
cycle works. Your question is a bit vague, so I don't fully understand the complexity of your application and so I can't provide a suitable solution to fix your problem.
Although for a quick fix, you can do something like this:
1) When you open your gallery, just set a BOOL to YES.
2) When you close your gallery and you enter in viewWillAppear
, just check if the BOOL is YES, if YES, then do not clear your variables.
3) Don't forget to reset your BOOL value again to NO.

Rui Peres
- 25,741
- 9
- 87
- 137