Reputation: 21
I'm trying to add a Modal ViewController to the existing application. To init and open it I use the following code
AddedViewController *addedOne = [[AddedViewController alloc] init];
[self.parent presentModalViewController:addedOne animated:YES];
If AddedViewController.xib with a View inside of course is just empty it opens nicely,
but
This throws SIGTRAP signal ((lldb) in log) at loading if AddedViewController.xib is not empty (i.e.) even if I add just a UILabel with static text there.
How can I handle this to have fully-operational ViewController (with labels, buttons, textfields, etc.. open properly?
========
UPD. Problem easily resolved, see my answer below. =)
Upvotes: 2
Views: 126
Reputation: 21
The answer was in Use Autolayout checkbox for the ViewController settings, now everything works fine TWIMC. =))
Upvotes: 0
Reputation: 14164
Assuming you are trying to present this inside the current view, you should not use self.parent
and just use self
.
Upvotes: 1