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.
}
I'm a relatively new iOS6 programmer. First off, I think that with ARC it should be just receivedData = [NSMutableData data]
?
Secondly, how should I declare the receivedData
instance variable? I'm guessing @property (strong, nonatomic) NSMutableData *receivedData;
in the header and @synthesize receivedData
in the implementation.
However, I'm still trying to grok multithreading and ARC in iOS6. Should the property declaration be
@property (strong, nonatomic) NSMutableData *receivedData;
or just
@property (strong) NSMutableData *receivedData;
for the received data in the delegate of an asynchronous NSURLConnection?