I need some help. I am calling the login function from another class,
// Login on server
- (BOOL) login:(NSString*) username password:(NSString*)password
{
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:subscribedAppsURL]];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connectionDict setObject:connection forKey:@"login"];
[connection release];
return true;
}
// delegate
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(@"Finished Loading");
if (connection == [connectionDict objectForKey:@"login"]) {
[connection release];
//@TODO Here I want to function login to return true.
}
}
At the end of connectionDidFinishLoading I want to return the TRUE/ FALSE value in the function login. Does anyone have some suggestions? Thanks!