jjramos
jjramos

Reputation: 2094

IBOutlets are nil on iOS 8 devices, but work fine on iOS 9 (Swift)

When running iOS 8, the IBOutlets of my nib based view controllers are nil, but when running iOS 9, they work fine. Any ideas why this might be happening?

My app supports iOS 8+, and I'm running Xcode 7.2.

Upvotes: 12

Views: 653

Answers (1)

jjramos
jjramos

Reputation: 2094

The problem was in the way my UIViewController was instantiated. Changing let myVC = MyViewController()

for let myVC = MyViewController(nibName: "MyViewController", bundle: nil) fixed the problem.

Upvotes: 11

Related Questions