Addresponse - hinzufügen von Speicher nur (XCode)

Ich versuche eine Verbindung zu meinem Projekt auf eine php-Datei, aber jedes mal, das zeigt:

ADDRESPONSE - ADDING TO MEMORY ONLY

Ich noch nie zuvor gesehen haben.
dies ist der code den ich Benutze:

//Gets the php
FindURL = [NSString stringWithFormat:@"http://domain.com/Myfile.php?username=%@", Username.text];
//to execute php code
URLData = [NSData dataWithContentsOfURL:[NSURL URLWithString:FindURL]];

//to receive the returend value
DataResult = [[NSString alloc] initWithData:URLData encoding:NSUTF8StringEncoding];

NSLog(@"%@",DataResult);

Was kann ich tun?

Vielen Dank im Voraus

Update-code:

- (IBAction)UpdateList:(id)sender{



    NSURLRequest *request=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://domain.com/Myfile.php"]
        cachePolicy:NSURLRequestUseProtocolCachePolicy
        timeoutInterval:15.0];
    NSURLConnection *Connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
    if (Connection) {
        //Connect
    }else{
        //Error
    }

}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
    DataResult = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

    NSLog(@"%@", DataResult);

}
Schreibe einen Kommentar