簡體   English   中英

如何檢查是否已調用此方法?

[英]How do I check to see if this method has been called?

如何檢查是否已調用此方法(或者狀態是否為true)?

 [self.view addSubview:menu];

我需要編寫一個條件語句進行測試,以查看這是否正確:

[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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM