Is there a way to check if a UIViewController is loaded in memory/visible on screen?
Something like this:
if([ContentRvController exists]){
contentView *ContentRvController = [[contentView alloc]
initWithNibName:@"contentView" bundle:nil]; //ContentView is a custom UIViewController
....
//Code to set the UIViewController
....
}
else{
[ContentRvController release];
}
That should happen when a button (that right now initializes the ViewControllers) is tapped. Right now, when tapped it opens n ViewControllers, it is supposed to display only one at a time.
Thats pretty much it, greetings and hope you can help me out.
Is this based on existing code?
Classes should start upper case, and instances should be camel case, e.g.
it is probably worth declaring it in the header, i.e.
and then in code you could do
Also, don’t do the else{[contentRv release];} bit, if you have autoreleased it anywhere, this will leak at some point.