views:

171

answers:

3

I want to check what the current view is objective c (in cocoa touch)

Could I do something like this?

if (viewA == current view) {

run code here

}

Thanks

A: 

if you are in a Controller just do the following

currentView = self.view;
zPesk
+2  A: 

See this SO question.

Naaff
+1  A: 
UIView *view1;
UIView *view2;
UIView *view3;


self.view = view1;



if (self.view==view1){

//do something

}
Corey Floyd