Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何检查是否已调用此方法(或者状态是否为真)?
[self.view addSubview:menu];
我需要编写一个条件语句来测试这是否为真:
谢谢你的帮助
菜单是视图吗?
所以,
if (menu.superview == self.view)
将测试是否根据需要添加了菜单
if(menu.superview == aSpecificView) // if true then menu is added as subview
如果您想检查特定视图,请执行此操作
if(menu.superview==aSpecificView) //do code here