1
votes

I have a UITableViewCell subclass which draws a rectangular vertical line of 5px width and height of 100. I am using a UIView for this. However I am a bit afraid o the performance of using UIView. Is it better to use core graphics for stuff like this instead? If yes then how would you convert the following:

UIView *vLine = [UIView alloc] initWithFrame:CGRectMake(10, 0, 5, 100)]; [self addsubView:vLine] [vLine release]

How do you convert the above using CG?

1
You should measure the performance: if you get 30..40 fps, you don't need to improve on it any longer.Sergey Kalinichenko

1 Answers

2
votes

That is fine and won't cause a performance issue as long as it is not called with each invocation of cellForRowAtIndexPath Instead, create and add the subview only when an attempt to grab a reusable cell fails.