0

I'm making RadioPlayer with model, view and controller. Model would be a shared instance and all initialization (play, pause etc.), view is just button and slider and controller should merge view and model...

Now I've got problem how to do this especially if using nibs... Here is good example with programatically written uiview (using loadView in ViewController) .- Objective-C, Need help creating an AVAudioPlayer singleton (Wolfgangs solution) but I would like to do it with nib.

So in short - Create nib for UIView, add that view to its controller (with its model). So this would be only controller for that view (slider + play/pause) not whole view (iPhone screen).

Thanks.

Community
  • 1
  • 1
Želja Huber
  • 337
  • 5
  • 14
  • You can create a view as per your need, and then you can add the controller as a child view controller. In this way you can have a view with its own controller and model as well. Hope this helps. – Rajat Apr 08 '14 at 18:59
  • possible duplicate of [Interface Builder - How to create a custom UIView with many subviews](http://stackoverflow.com/questions/18109741/interface-builder-how-to-create-a-custom-uiview-with-many-subviews) – Kunal Balani Apr 08 '14 at 20:06
  • This is what the guy that gave solution wrote: "The limitation of this method, is that your outlets belong to the view class and not the view controller, which may not (but could be) be the right thing to do in a MVC sense.".. Thats exactly my problem so I can't use his code... – Želja Huber Apr 09 '14 at 07:55

0 Answers0