how to use delegates with Automatic Reference Counting

Viewed 18528

I've jumped on the ARC bandwagon. In the past I would have my delegate properties declared like this:

@property(assign) id<MyProtocol> delegate;

So I thought I would do this under ARC:

@property(weak) id<MyProtocol> delegate;

Not so. On the @synthesize statement in the .m I have a compile error:

*Semantic Issue: Existing ivar 'delegate' for __weak property 'delegate' must be __weak*

I HAVE declared it as weak though! Also how do I pass a class implementing a protocol to a weakly referenced property. Do I have to wrap it in one of those weird obj_unretained calls?

Any help on this would be very much appreciated.

1 Answers
Related