CGRect myImageRect = CGRectMake(3165, 1197, 332,43);
UILabel *myLabel = [[UILabel alloc] initWithFrame:myImageRect];
myLabel.text = @"WASHINGTON D. C.";NSAutoreleaseNoPool():UICFFont类的对象0x7a39750,没有池-只是泄漏NSAutoreleaseNoPool():UITextRenderingAttributes自动释放的对象0x6fc3920,没有任何池-只是泄漏
以上代码中的断点的堆栈跟踪可以在这里找到:img52 52/9616/tutc.png
我使用的是iPhone WWDC 2010-104 PhotoScroller (包括贴图View.h)
如何解决这个问题?
发布于 2010-12-12 15:35:03
此代码是在后台线程上运行的吗?
您需要创建一个自动释放池。
// At the start of your thread
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
...
CGRect myImageRect = CGRectMake(3165, 1197, 332,43);
UILabel *myLabel = [[UILabel alloc] initWithFrame:myImageRect];
myLabel.text = @"WASHINGTON D. C.";
...
// At the very end of your thread
[pool release];https://stackoverflow.com/questions/4422308
复制相似问题