Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
London , UK
Im curious on the theory behind doing this. I wish to have certain view to display an objects details in a specific way (see below). But I wish to have the view repeat for the amount of objects and have them inside the a scroll view.

How would I deal with repeating the view for the right amount of times ?
 

Attachments

  • Picture 2.png
    Picture 2.png
    10 KB · Views: 96

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
You could create a controller class for the view. This controller holds a reference to an object from your model, and an IBOutlet to the view. Then you can initialize each controller separately and add the controller's view to the scroll view.
 

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
London , UK
Thanks again kainjow.

So I would create the NSView once and make instances and add them to the view programatically ?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Yep, create it once in IB, but instantiate multiple instances in your code.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.