I'm trying to get data and show in tableView. As I have to send Request in viewDidLoad. But it took much time while loading my data, so I need it to be done in async way. Any Suggestions or Recommendations.?
- (void)viewDidLoad {
//------castApi----//
[super viewDidLoad];
[[self tableView2]setDelegate:self ];
[[self tableView2]setDataSource:self];
array=[[NSMutableArray alloc]init];
NSString *castString = [NSString stringWithFormat:@"https://api.themoviedb.org/3/movie/%@/credits?api_key=c4bd81709e87b12e609433c49",movieIDinString];
NSURL *url=[NSURL URLWithString:castString];
NSURLRequest *request=[NSURLRequest requestWithURL:url];
connection=[NSURLConnection connectionWithRequest:request delegate:self];
if (connection){
webData= [[NSMutableData alloc]init];
}
}