【发布时间】:2009-02-12 06:37:53
【问题描述】:
我想从 URL 中获取 NSData 对象的内容。就内存使用 dataWithContentsOfURL(或 initWithContentsOfURL)或使用 NSURLConnection 而言,更有效的方法是什么?
我应该使用
NSData *data = [[NSData alloc] initWithContentsOfURL:myURL]
或
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
【问题讨论】: