How to access the string data outside the function and class
<p>I am trying to access the nsstring data out side the function and also outside the class.</p>

<p>How can I access <code>useridStr</code> outside the function and class? This is my code:</p>

<pre><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);
}
</code></pre>
