ipad subview not loading before code is executing
Posted
by ethan Criss
on Stack Overflow
See other posts from Stack Overflow
or by ethan Criss
Published on 2010-06-11T19:39:00Z
Indexed on
2010/06/11
19:42 UTC
Read the original article
Hit count: 189
I have a command that should be loading a subview before a particular piece of time intensive code executes. However the command runs, the timely code executes and then the subview shows up. Is there anything I can do to fix this problem?
progressViewController = [[ProgressView alloc] initWithNibName:@"ProgressView" bundle:[NSBundle mainBundle]];
[self.view addSubview:[progressViewController view]];
NSString *name=@"guy";
NSString *encodedName =[[NSString alloc] init];
int asci;
for(int i=0; i < [name length]; i++)
{
//NSLog(@"1");
asci = [name characterAtIndex:i];
NSString *str = [NSString stringWithFormat:@"%d,", asci];
encodedName =[encodedName stringByAppendingFormat: str];
}
NSString *urlString = [NSString stringWithFormat:@"someurl.com"];
NSURL *theUrl = [[NSURL alloc] initWithString:urlString];
NSString *result=[NSString stringWithContentsOfURL:theUrl];
result = [result substringFromIndex:61];
result = [result substringToIndex:[result length] - 20];
NSLog(result);
outLab.text=result;
[[progressViewController view] removeFromSuperview];
© Stack Overflow or respective owner