Is it correct to use __weak arguments in Obj-C?

Here’s a little example of using weak arguments:

@interface MYTestObject : NSObject


@implementation MYTestObject {

- (void)dealloc {

- (id)init {
   if (self = [super init]) {
      [self doSomethingWithObject:self];
   return self;

- (void)doSomethingWithObject:(id __weak /* <- weak argument! */)obj {
   _block = ^{
      NSLog(@"%p", obj);


And it works: -dealloc is called! Also, if you remove __weak you’ll get a retain-cycle and it’s absolutely correct.

Wonder, if that’s just a side-effect and it’s completely unsafe to use weak arguments? Or is it a specified behavior and I’m just a bad google-user?


Here’s my question on SO: