Reputation: 47
I have UIView
subclass
class GraphView: UIView {
var test = false
}
And when I'm trying to get access to the test
property via @IBOutlet
, I get exc_bad_access
error.
What is my problem?
Upvotes: 0
Views: 244
Reputation: 304
I just had this issue. It turned out the viewController's view was connected to the IBOutlet, instead of my custom view
Upvotes: 1
Reputation: 53
The reason can be, you are trying to access the property of the @IBOutlet before the view has loaded.@IBOutlet is initialised only when view containing the outlet is loaded.
Upvotes: 1