ios ARC strong and alloc

℡╲_俬逩灬. 提交于 2019-12-13 09:12:09

问题


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;
}

Is that code ok under ARC?


回答1:


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



来源:https://stackoverflow.com/questions/12166323/ios-arc-strong-and-alloc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!