ios ARC强和分配

ios ARC强和分配

问题描述:

我有一个与ARC有关的问题.在我的界面中,我已将uiwebview声明为strong属性.在我的代码中,我像这样延迟加载:

I have a question related to ARC. In my interface I have declared a uiwebview as a strong property. Inside my code I have lazy loading like so:

- (UIWebView *)aWebView{
    if(aWebView == nil){
        aWebView = [[UIWebView alloc] initWithFrame:self.bounds];
    }
    return aWebView;
}

在ARC下该代码还可以吗?

Is that code ok under ARC?

是的,很好. ARC将为您提供发行要求.

Yes, it's fine. ARC will include the release call for you.