If I create a separate nib file and upload it to my view manager and assign it to ivar as follows:
self.loadingview=[[[NSBundle mainBundle] loadNibNamed:@"loading" owner:self options:nil] objectAtIndex:0];
Is it possible to create IBOutlets for any thing on it in a loop, for example, activity indicators? Would the viewcontroller be the file host, although IB would not know this since it became an object in the code?
Is loading a needle the way I made it an acceptable practice?
Perhaps a more acceptable practice is to create .h / .m and use this as a class for XIB, in which case File Owner is a new custom class; I still have to use the above method in my controller, although when creating ivar from a user class, right? Or is there a better way to do all this without using an xib controller?
UPDATE. Based on some answers, I did the following. I got rid of the NSBundle method above, and instead do the following:
@property (nonatomic, retain) IBOutlet UIView*loadingview;
In the nib file for this view, I click "File Owner" and change the Custom Class to my view manager. Then I control the drag and drop from File Owner to View and it binds perfectly.
I would suggest at this point that I now have ivar in my controller, self.loadingview , which contains information in nib. However, it is not. I removed the NSBundle method, assuming that the controller will now load the thread directly through IB output, but the view in the tip is not displayed, and I do not control it in the controller.
I also deleted this when I deleted the NSBundle method:
[self.view addSubview:self.loadingview];
I do not understand how the view is actually displayed; and if that happens, then where does the hierarchy appear to be? perhaps this is for other views. I also tried:
[self.view bringSubviewToFront:self.loadingview];
But there is simply no vision. Trying to find him, I did:
//[self.view bringSubviewToFront:self.loadingview];
NSLog(@"index: %i",[[self.view subviews]indexOfObject:self.loadingview]);
both with and without comment. I get the following:
index: 2147483647