Reputation: 6614
How do I check to see if this method has been called (or if the state is true perhaps)?
[self.view addSubview:menu];
I need to write a conditional statement that tests to see if this is true or not:
[self.view addSubview:menu];
thanks for any help
Upvotes: 1
Views: 106
Reputation: 8947
if(menu.superview == aSpecificView)
// if true then menu is added as subview
if you want to check specific view then do this
if(menu.superview==aSpecificView)
//do code here
Upvotes: 2
Reputation: 12890
Is menu a view?
so,
if (menu.superview == self.view)
would test if menu has been added as desired
Upvotes: 3