Today, a colleague asked me why I used assign to declare attributes in objective-C delegate. I checked the information on the Internet and summarized it as a memory management problem in objective-C. I copied the foreigner's answer directly:
The reason that you avoid retaining delegates is that you need to avoid a retain loop:
A creates B a sets itself as B's delegate... A is released by its owner
If B had retained a, a wouldn't be released, as B owns a, thus a's dealloc wocould never get called, causingBoth A and BTo leak.
You shouldn't worry about a going away B/C it owns B and thus gets rid of it in dealloc.
Link: http://stackoverflow.com/questions/918698/why-are-objective-c-delegates-usually-given-the-property-assign-instead-of-retain
You can understand it. Stackoverflow is really easy to use and solves many of my technical problems.