3

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

etayluz
  • 15,920
  • 23
  • 106
  • 151

1 Answers1

0

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

Community
  • 1
  • 1
etayluz
  • 15,920
  • 23
  • 106
  • 151