Independently stored inside this Objective-C block?

When I have a block in Objective-C that looks like this:

self.request = [[ASIHTTPRequest requestWithURL:...

[self.longPollRequest setCompletionBlock:^{
    NSLog(@"%@", self.request.responseString);
}];

save selfor explicitly save self.request?

+5
source share
1 answer

The Block Programming Topics section says:

In a default reference counting environment, when you reference an Objective-C object inside a block, it is saved. This is true even if you just reference the instance variable of the object. Values ​​of object variables with storage type __block modifier, however, are not saved.

, :

, self ;

, .

self , self .

+8

All Articles