Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View removed before it loads

I am trying to remove a View after getting data from webservice.

But when I removes the view using

[self.view removeFromSuperView];

the view gets removed before loading the required data. I need to load the data and then remove the view. Is there a way to implement this?

like image 877
itZme Avatar asked Nov 06 '22 02:11

itZme


1 Answers

if you are using NSURLConnection then you should use the delegates methods which is

-(void)connectionDidFinishLoading:(NSURLConnection *)connection

Here you can easily do the removing part of the view. and it will not crash unless got response.

like image 111
Filthy Knight Avatar answered Nov 12 '22 19:11

Filthy Knight