Guys i am facing an odd problem with NavigationController. Existing answers did not help at all !!!!
Here is basic scenario of the app:
- There are two views - Main and Second view
- In main view there is a button when i happen to tap goes into second view using segue.
- In second view after i enter a certain field in text view and click on a button called "join" it triggers "joinMeeting()" function and meeting should be joined.
However, when i do that debugger shows me:
"Warning: Attempt to present on <***.ViewController: *****> whose view is not in the window hierarchy!"
So i have read most of the tread and given that it happens because of viewDidAppear method but i have nth to be done before viewDidAppear. Everything happens after button is clicked.
joinMeeting() is successfully called and print method returns 0 which means no issue(https://developer.zoom.us/docs/ios/error-codes/) and successful SDK connection however after this "Warning" error is shown in debugger and nothing happens in the app.
If it helps following is the code that triggers joinBtn:
/**
Triggers when Join Button is clicked from second view.
*/
@IBAction func joinMeeting(_ sender: Any) {
if( activityID.text == "" ) {
let alert = UIAlertController(title: "Field is Blank", message: "Activity ID cannot be blank.", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
return;
}
let ms: MobileRTCMeetingService? = MobileRTC.shared().getMeetingService()
if ms != nil {
ms?.delegate = self;
// //For Join a meeting
let paramDict: [AnyHashable: Any] = [
kMeetingParam_Username: kSDKUserName,
kMeetingParam_MeetingNumber: activityID.text!,
]
let ret: MobileRTCMeetError? = ms?.joinMeeting(with: paramDict)
print("onJoinaMeeting ret:\(String(describing: ret))")
}
}
Please help if anyone knows or have an idea on what i am missing here.
joinMeeting(with:). Without a Minimal, Complete and Verifiable example your question is considered off-topic. - Dávid Pásztorms?.joinMeeting(with: paramDict)cannot be calling the IBAction calledjoinMeetingsince their function signatures are clearly different. It seemsMobileRTCMeetingServicehas another method calledjoinMeeting(with:)and that is the one you are calling on the problematic line, notjoinMeeting(_:), which is an IBAction connected to your UIButton. - Dávid Pásztor