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.
}
我是一个相对较新的 iOS6 程序员。首先,我认为ARC应该只是receivedData = [NSMutableData data]
?
其次,我应该如何声明receivedData
实例变量?我猜@property (strong, nonatomic) NSMutableData *receivedData;
在标题和@synthesize receivedData
实现中。
但是,我仍在尝试在 iOS6 中探索多线程和 ARC。财产声明应该是
@property (strong, nonatomic) NSMutableData *receivedData;
要不就
@property (strong) NSMutableData *receivedData;
在异步 NSURLConnection 的委托中接收到的数据?