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.
モーダルポップアップビューコントローラから現在のビューコントローラを参照できるようにするためのプロパティはありますか?あるべきだと思われます。parentViewController正しいViewControllerではないようです。
parentViewController
このスレッドへの将来の訪問者のために、iOS5以降、ビューコントローラーには「presentingViewController」参照があります。
私はいつも:
ポップアップビューコントローラ用に独自のサブクラスを作成します。
「親」UIViewController変数を追加します
私がそれを割り当て/初期化した後、そして私がそれを提示する前に、「親」を右に設定します。
必要なときにポップアップから「親」変数を参照します。