Closed jaredholdcroft closed 11 years ago
It sounds like the view controller's being deallocated before its associated view is.
Be sure to keep your view controller alive as long as your view is, and to remove the view from the view hierarchy when your view controller is deallocated.
Changing this to be OBJC_ASSOCIATION_RETAIN_NONATOMIC has fixed my problem but i'm not sure of the full impact of this.
The view controller retains the view, so this would create a retain cycle (with the view also retaining the controller in turn).
I finally tracked down the problem - somehow in one of our xibs the rbl_viewController outlet had been manually connected up the parent NSViewController!
Thanks for replying so quickly to my issue, it was a big help.
Hi,
I'm fairly new to OSX dev and very new to Rebel so i'm sure i'm missing something obvious here.
I'm using Rebel, via cocoapods, and as i've started to add more complex view hierarchies I have started to get EXC_BAD_ACCESS errors at line 61 of NSVIew+RBLViewControllerAdditions:
Looking through the code I noticed that the rbl_viewController object association policy is assign i.e. a weak reference. Changing this to be OBJC_ASSOCIATION_RETAIN_NONATOMIC has fixed my problem but i'm not sure of the full impact of this. I guess my main question is - what could I be doing wrong so that I need to retain this reference?
It happens a in 10.8 and 10.9 and we're using ARC.
Full stack trace: