Triggering segue causes view to change only after i press home button and click on app again ios storyboard

StackOverflow https://stackoverflow.com/questions/17112070

  •  31-05-2022
  •  | 
  •  

Question

I am making a calling app in ios using pjsip.

I have a segue from a view controller to a tab bar controller.

when I call this segue in the foll function - (IBAction)endCall:(id)sender
(which is called on clicking on a button) , all is fine.

But I also have to call it at another time : when i receive a callback (from pjsip) that call session has been terminated (this is in another file) , i post notification and listen to it in my view controller class. Then i call this endCall function.

The problem i face is that on doing so the view does not change, it changes only when I click on Home button and again click on the app.

Any idea why this is happening?

Was it helpful?

Solution

It might be because the UI in iOS is only updated on the main thread. It's possible that the function you are calling the segue in is somehow blocking the main runloop. See NSTextField waits until the end of a loop to update for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top