I asked how I can make a custom view repeat in several separate instances, and I was told that I should use NSNib or NSViewController. I have a custom view in the nib file, whenever the user clicks the button, I want a new copy of the nib view to appear, while preserving the previous one in another place on the screen to view up to ten separate views at a time. Since each of them accepts some user input before appearing, I assume that they should be separate objects or something to make them clear and not interfere with each other.
I can do the first of the views using
NSNib *nib = [[NSNib alloc] initWithNibNamed:@"IndividualTimers" bundle:nil]; [nib instantiateNibWithOwner:self topLevelObjects:nil];
But it just repeats the same view each time the button is pressed, I can say that both views were combined into this view, because the timer that appears on it starts ticking twice as fast, but they should be independently visible in two different view instance.
Someone told me what I should use to set a different file owner.
So far, people have been helpful, but not very specific. I donβt know what the file manager should be, how to programmatically create a new object to store each instance of the loaded nib (even if thatβs how it is done), or if I need a separate object for each download.
Basically, I want to know how to take one nib file, and use it as a template to load up to ten separate times, while each of (up) ten views works simultaneously, but independently.
I would really appreciate any specific help you could give, as this is the biggest problem I encountered when programming in Xcode. I was stuck for several weeks. Thanks for the help.