nsstring - out of scope
Posted
by alexeyndru
on Stack Overflow
See other posts from Stack Overflow
or by alexeyndru
Published on 2010-05-17T18:20:52Z
Indexed on
2010/05/17
18:30 UTC
Read the original article
Hit count: 466
objective-c
-(void)loadWebAdress:(NSString*)textAdress {
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
adressurl=[NSString stringWithFormat:@"http://%@", textAdress];
NSURL *url=[NSURL URLWithString:adressurl];
NSURLRequest *requestObj=[NSURLRequest requestWithURL:url];
[webview loadRequest:requestObj];
}
although url takes it's value from adressurl, adressurl is all the time out of scope when checked in debugger. what is going on? i would like to use it in some other places too. not only in this method. because is out of scope, the app crashes. But, I repeat, it is the one who gives its value to url.
© Stack Overflow or respective owner