I am trying to access the nsstring data out side the function and also outside the class.

How can I access `useridStr` outside the function and class? This is my code:

```
-(id)connectionDidFinishLoading:(NSURLConnection *)connection
{
    NSString *loginStatus = [[NSString alloc] initWithBytes:[webData mutableBytes]
        length:[webData length] encoding:NSUTF8StringEncoding];
    NSDictionary *loginDict = [[loginStatus JSONValue] objectForKey:@"UserDetails"];
    NSArray *userId = [loginDict valueForKey: @"userid"];
    NSString *useridStr = [userId lastObject];
    NSLog(@"--------------....%@", useridStr);
}

```