ARC verbietet explizite Meldung senden 'behalten' Problem

Ich bin mit dieser sehr einfachen code aus dem Apple-Handbuch:

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.
}

Aber für die Linie receivedData = [[NSMutableData data] retain]; Xcode gibt mir eine Fehlermeldung: PushController.m:72:25: ARC forbids explicit message send of 'retain'

Umgang mit ihm? Ich bin mit Xcode 4.4.1

Das ist der Punkt, der Bogen rechts, so dass Sie nicht haben, um halten und loslassen ...
möglich, Duplikat der Einige Fragen über Automatic Reference Counting in iOS5 SDK

InformationsquelleAutor Kir | 2012-08-09

Schreibe einen Kommentar