問題の説明
StdString ShowLockScreen()この関数には、ユーザーがPINを入力する必要があるUIを表示する関数を呼び出します。関数を呼び出しactivateViewControllerた直後に、activateViewControllerユーザーがPINを入力し、開いたUIで[OK]ボタンを押すまですべてのプロセスをロックします。以下に私が試したコードを見ることができます
iOSのソースコード
StdString ShowLockScreen() 
{
    // Create a lock.
    NSLock* theLock = [[NSLock alloc] init];
    // Create a UI in which user must enter his PIN.
    PinLockController* controller = [[PinLockController alloc] initWithStyle:PinLockTypeSet];
    // Set delegate. 
    controller.delegate = m_Context;
    // !!! Here I show a UI and just after that I lock my lock in order code stop executing there.
    [controller activateViewController:nil];
    @synchronized(theLock) {
        [theLock lock];
    }
    NSLog(@"User in UI unlock the lock");
}
コードを停止してから呼び出し[theLock lock];、その後[theLockunlock]を呼び出します。UIとコードから実行を継続します。しかし、私の場合は機能しません。
Androidのソースコード
私はAndroidで同様のアプリケーションを作成しましたが、ここにコードがあります。iOSで同じように書きたいのですが、解決策が見つかりません
Intent intent = new Intent(mCtx, SoftPinActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
SharedObject lock = new SharedObject("");
int lockId = SharedObject.acquireLockId(lock);
Logger.i(TAG, "lockId = " + lockId);
intent.putExtra(SharedObject.LOCK_ID, lockId);
intent.putExtra(SoftPinActivity.UI_ID, style);
synchronized (lock) {
   mCtx.startActivity(intent);
   try {
          Logger.i(TAG, "lock.wait()...");
          lock.wait();
   } catch (InterruptedException e) {
          e.printStackTrace();
          Logger.i(TAG, "InterruptedException");
   }
}
Logger.i(TAG, "lock.wait()...done");
SharedObject.releaseLockId(lockId);
String pin = lock.object();
研究
私は使用しなければならないと思います
NSCondition* condLock = [[NSCondition alloc] init];
[condLock wait];
と
[condLock signal];
しかし、これを私のコードでどのように使用するのですか?