Why does Apple use assign rather than weak to store a delegate?
问题 Some Cocoa and Cocoa Touch classes declare their delegate properties as assign rather than weak , which forces users of the class to nil out the property in dealloc -(void)dealloc { self.imageScrollView.delegate = nil; self.tableView.delegate = nil; self.tableView.dataSource = nil; } Which is very cumbersome. Why would Apple do it this way? 回答1: The reason why is that not all system classes have been compiled with ARC. You may implement a dealloc method if you need to manage resources other