I want to know how can I invoke(access) a subView that I’ve created it using IB
I’ve used this code but no chance :
mySubView * mysbv = [mySubView alloc];
[mysbv setNeedsDisplay:YES];
but yet I will get compile error says undeclared mySubView where as I have create mySubView class and its attached to the window inside IB.
and by the way is it good practice to use components using IB or do I have to create them programmatically (although I have problem to it either)?
Using nib files is far more powerful; in general, code examples that create UI elements are from the prehistoric days before Apple supported IB for iPhoneOS.
Your code example really won’t work – you can’t ever just use
allocon its own. Create an IBOutlet property for your view controller, and connect it to your view; it will be available for use fromawakeFromNib/viewDidLoadonwards.