【发布时间】:2009-04-28 19:59:00
【问题描述】:
在文档中有一个 addObject: NSAutoreleasePool 方法。
我想过这个:
NSString *myString = [[NSString alloc] initWithCString:"这行得通吗?"]; [thePool addObject:myString]; [anotherPool addObject:myString];
这可能吗?我总是读到我只能将对象添加到自动释放池堆栈的最顶层。
【问题讨论】:
-
您似乎有很多与内存管理相关的问题。我认为仔细阅读内存管理编程指南 (developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/MemoryMgmt/…) 会对您大有裨益。您问题的所有答案都真实存在。祝你好运。
-
我确实读了两遍。但不幸的是,我无法理解他们试图解释的方式。
标签: iphone cocoa-touch uikit autorelease