Reputation: 3119
In my app I have a view controller written in Swift. I imported it in to app delegate which is written in objective c. I try to create an object of the swift view controller like this
ListAllSongsViewController *songListVC = [[ListAllSongsViewController alloc]initWithNibName:@"ListAllSongsViewController" bundle:nil];
The ListAllSongsViewController
is written in swift. The project compile without any issue but when executing the above line the app crashes & stops at init method of ListAllSongsViewController
There is nothing in the log, it just stops. Zombie & All exception break points are enabled.
P.S. It only crashes in device (iOS 7.1), but works fine in simulator
Update : Getting the same issue even if I use the default swift initialiser
ListAllSongsViewController(nibName: "ListAllSongsViewController", bundle: nil)
Upvotes: 1
Views: 2553
Reputation: 802
Usually occurs when you passed a wrong nibName
. Considering it crashes only in device, I think you've made a mistake about the case of the string ListAllSongs
, because the Mac/Simulator's file system is case insensitive while the device is not.
Upvotes: 1