【问题标题】:ios ARC strong and allocios ARC强和alloc
【发布时间】:2012-08-28 19:37:21
【问题描述】:

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

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

该代码在 ARC 下可以吗?

【问题讨论】:

    标签: objective-c ios automatic-ref-counting


    【解决方案1】:

    是的,没关系。 ARC 将为您提供发布电话。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-05
      • 2012-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多