I’m working on the silver challenge and I’ve gotten stuck at connecting the UISegmentedControl to my code. Here are the the things I’ve tried:
I wanted to right-click on it and then drag the delegate circle to file’s owner. Unfortunately, for reasons I don’t understand, there is no delegate option there – screenshot – just a list of events.
So I scoured the forums and I saw a couple people who noted that you could wire the UISegmentedControl to the file’s owner by doing a Ctrl-drag. I tried this, but it also didn’t work: I could drag to the first responder (which would get highlighted in blue before I released the drag), but when I dragged to the file’s owner nothing happened.
I’ve also looked at the documentation, which clearly states that you can use the UIControlEventValueChanged constant. I’m not sure where to put that constant for it to be checked by anything.
Another poster on this forum created a method called changedMapType that was added as a target, so I thought I’d try that. When I right-click on the UISegmentedControl, I see a nice list of events including Value Changed. So I tried to drag the little circle next to Value Changed to the file’s owner. But I got the same results as in attempt #2 above – nothing happened. I couldn’t drag to the file’s owner.
So what am I missing? Should I be connecting it to something besides the file’s owner? I wanted to model the UISegmentedControl setup like the UITextField’s setup, since they seemed so similar (both taking input from the user, both affecting the view in some way). Do I have some fundamental misunderstanding?
Thanks very much! I’ve been working on this over the weekend and I would be thrilled to know what’s going on.