I have attached a new thread and in that thread I'm firing 5 SQLite queries.
Problem is that until execution of all my queries is finished, I'm not able to scroll the table view. It freezes for some seconds.
-(void)viewDidAppear:(BOOL)animated
{
[NSThread detachNewThreadSelector:@selector(GetBackEndData)
toTarget:appDelegate withObject:nil];
}
// this is in appDelegate
-(void)GetBackEndData
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if([dicBarnearMe_Detail count]==0)
{
// this are sql queries method.
[appDelegate SelectBeersonbottle_Count];
[appDelegate SelectBeersonTap_Count];
[appDelegate SelectGrowler_Count];
[appDelegate SelectHappyHours_Count];
[appDelegate SelectEvents_Count];
// After completing this process I'm post notification
// for reloading table in other controller.
[[NSNotificationCenter defaultCenter] postNotificationName:@"reload"
object:nil userInfo:nil];
}
[pool release];
}