3
votes

I have a UISlider in the XIB file with an IBAction outlet hooked up to its corresponding view controller. Everything looks fine (see image below). However, when I actually move the slider in the simulator - the Value Changed (sliderValueChanged in the image) target is NOT being called. I have verified that viewDidLoad is being called and that the view controller is hooked up to the XIB.

Help!

enter image description here

1
uff. i set up a quick demo project with a viewcontroller from xib and everything works as expected. would you like to share your project?André Slotta
You know, I started with a scene that was in a storyboard - then I cut and pasted the view inside that scene into an XIB file. I think it's screwing up with XCode.etayluz
yeah, has to have something to do with that...André Slotta
hmm... maybe a private repository on github? or you can archive and send it via mail. [email protected].André Slotta
ok... you got mail!André Slotta

1 Answers

0
votes

I found the issue. The view controller wasn't retained in my project - so there was nothing for the slider to call on. Really silly. No problem with the XIB file at all. I always thought that the view retains it's view controller - and that the view is retained so long as it's in the view hierarchy. Am I wrong? Special thanks to @AndreSlotta for helping me.

EDIT: Apparently a view does NOT retain its view controller: Does a UIView retain its view controller