0
我需要確認這一點。引用爲代表的對象範圍
我有這樣的代碼
@implementation A
(void) read
{
NSURLConnection *conn =
[[NSURLConnection alloc] initWithRequest:request delegate:self];
...
}
@end
@implementation B
(void) someFn()
{
A anObject = [A alloc] init]
[anObject read]
}
@end
會anObject
是一個有效的對象,直到連接完成,因爲它是作爲委託NSURLConnection的傳遞?