1
下面的代碼ivI'e照片幻燈片的教程遇到我認爲是一些廢棄的代碼。我有一個autorelease
ARC錯誤並setDelegate:self
autorelease已棄用,是否有替代方案?
NSXMLParser *photoParser = [[[NSXMLParser alloc]
initWithContentsOfURL:[NSURL URLWithString:
@"http://localhost/photos/index.xml"]] autorelease];
[photoParser setDelegate:self];
這不是「過時」(這意味着它不會在將來支持)。在使用ARC時,您不需要編寫它(編譯器會在適當的位置放入'retain','release','autorelease'等)。 –