UIView as opposed to UIViewController...
UIView as opposed to UIViewController...
- Subject: UIView as opposed to UIViewController...
- From: Jon <email@hidden>
- Date: Sat, 06 Mar 2010 19:57:32 -0700
I get indications from reading that you shouldn't really subclass UIView in general or to do routine things, and that any time you implement drawRect in the subclass of a UIView, you are taking a performance hit compared to doing some drawing in other ways?
is this true, in the case of doing this in the ViewController, is this below more efficient? or better? or what?
- (void)viewDidLoad {
[super viewDidLoad];
trailersViewPlane = [[UIImageView alloc] initWithImage:nil];
trailersViewPlane.frame = self.view.frame;
theBounds = CGRectMake(0, 0, trailersViewPlane.frame.size.width, trailersViewPlane.frame.size.height);
[self.view addSubview:trailersViewPlane];
then drawing within an NStimer loop in this added subView inside the viewController? (the subview bounds are as big as the whole view)
etc....
I guess i am not sure which way to go.. (do everything in a UIView subclass, or do everything in a UIViewController subclass.)
it doesn't seem like anything you do in the controller, is easy to get to draw in a UIView subclass, and maybe equally hard to get stuff to translate over to the controller if you do a lot of work in the UIView...
i'm just lost as to how an NSTimer and a looping set of code should be worked into these two classes.. should it be in the UIView? or the Controller? seems like it should be in the controller, but then really all the work has to be in the controller, since you can't even call the drawRect while in the controller, so what would you do in the UIView?
any of that make sense?
thanks in advance,
Jon.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden