美文网首页
NSAutoreleasePool autorelease

NSAutoreleasePool autorelease

作者: 传说中的汽水枪 | 来源:发表于2019-06-16 18:33 被阅读0次
void test_autoreleasePool_autorelease() {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    [pool autorelease];
    [pool drain];
    [pool release];
}

// Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSAutoreleasePool autorelease]: Cannot autorelease an autorelease pool'

[NSAutoreleasePool autorelease] 被重写了,直接抛出异常

相关文章

网友评论

      本文标题:NSAutoreleasePool autorelease

      本文链接:https://www.haomeiwen.com/subject/daggfctx.html