私はAppleガイドからのこの非常に単純なコードを使用しています:
NSMutableData *receivedData;
// Create the request.
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
// create the connection with the request
// and start loading the data
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
// Create the NSMutableData to hold the received data.
// receivedData is an instance variable declared elsewhere.
receivedData = [[NSMutableData data] retain];
} else {
// Inform the user that the connection failed.
}
しかし、その行のreceivedData = [[NSMutableData data] retain];
Xcodeは私にエラーを与えます:PushController.m:72:25: ARC forbids explicit message send of 'retain'
どのように対処しますか?Xcode4.4.1を使用しています