我需要能夠在等待用戶輸入時停止方法。在繼續執行方法之前等待可變時間完成
我試着用while (true)
循環檢查是否設置了一個表示操作已完成的布爾值,但正如我預測的那樣,它使應用程序無法響應。
如何在設置了變量後暫停和恢復方法,而無需再次調用方法,並且不會使整個應用程序無響應。
這裏基本上什麼程序呢
openFile method called
openFile method determines whether file has a password
if it does, display an alert to the user requesting the password
這裏的問題,停止該方法,直到密碼已經輸入。
任何幫助表示讚賞。
是的,那是最好的選擇。 –