I have table view in that click any i am displaying data in overlay view (overlay contain scroll view i adding near about 30 components like label , text View for each page )with near about with 20 pages
My code in didSelectRowAtIndexPath
_scrollViewOverlay = [[UIScrollView alloc] initWithFrame:CGRectMake(13, 103, 292, 273)];
_scrollViewOverlay.pagingEnabled = YES;
_scrollViewOverlay.backgroundColor = [UIColor colorWithRed:10.0f/255.0 green:132.0f/255.0f blue:217.0f/255.0f alpha:1];
_scrollViewOverlay.delegate=self;
[_viewOverlay addSubview:_scrollViewOverlay];
[_scrollViewOverlay release];
for(int iCount = 0;iCount<[_arrayDeatil count];iCount++)
{
//here i am adding 8 label and 4 textFields to _scrollViewOverlay for each page
}
Now problem is that In Device its getting block near about 10 secs.how can i over come this problem please help me…
You should use a similar approach to UITableView. You need to only load into memory what is necessary for what you have on screen, and potentially a couple off screen to ease scrolling. You’ll likely want to implement a reuse queue as well, exactly as done in UITableView.