Who is responsible for releasing objects in an array when copying?
问题 In Objective-C, if array1 is copied onto array2 using mutableCopy, and suppose the code is done in main(), who is responsible for releasing the objects contained in the array? Is it main() or array2? 回答1: I think the previous answers have missed the point, or else the asker was pretty unclear. The actual question isn't talking about either array, but rather the array contents: who is responsible for releasing the objects contained in the array ? Is it main() or array2? Both array1 and array2