.mファイルに次のコードがあります。
- (IBAction)LoginButton:(id)sender {
// create string contains url address for php file, the file name is phpFile.php, it receives parameter :name
NSString *strURL = [NSString stringWithFormat:@"http://www.myURL.com/verify.php?Email=%@",Email.text];
// to execute php code
NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
// to receive the returend value
NSString *strResult = [[[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding]autorelease];
NSLog(@"%@", strResult);
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Result:"
message:strResult
delegate:nil
cancelButtonTitle:@"Okay"
otherButtonTitles:nil];
[alert show];
}
また、自動参照カウントモードでは自動解放が利用できないようになっています。
次の行に問題があるようです。
NSString *strResult = [[[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding]autorelease];
どうすればこれを解決できますか?