block弱引用

__weaktypeof(self) weakSelf =self;

[WM_NetworkServicegetDepartWithBlock:^(NSDictionary*result,NSError*error) {

NSLog(@"%@",result);

weakSelf.OperateNameArray= [NSMutableArrayarrayWithCapacity:0];

weakSelf.OperateInfoArray= [NSMutableArrayarrayWithCapacity:0];

for(NSDictionary*dicinresult[@"result"]) {

//NSString *str = dic[@"COM_NAME"];

NSString*str = [WM_SingledefaultSingle].INFO_USER;

StoreModel*model = [[StoreModelalloc]initWithDataDic:dic];

[weakSelf.OperateInfoArrayaddObject:model];

[weakSelf.OperateNameArrayaddObject:str];

}

_popView= [[PopoverViewalloc]initWithPoint:CGPointMake(251,245-juli)titles:self.OperateNameArrayimages:nil];

_popView.selectRowAtIndex= ^(NSIntegerindex){

StoreModel*model = weakSelf.OperateInfoArray[index];

//            header.OperatorLabel.text = model.COM_NAME;

//weakSelf成员变量添加weakSelf弱引用

weakSelf.DEP_ID= model.DEP_ID;

//            COM_NAME = model.COM_NAME;

};

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1、设置UILabel行间距 NSMutableAttributedString* attrString = [[...
    FF_911阅读 5,261评论 0 3
  • 1、禁止手机睡眠[UIApplication sharedApplication].idleTimerDisabl...
    DingGa阅读 4,808评论 1 6
  • 初学JavaScript经常被this绕晕,所以我总结一下JavaScript中的this。首先声明本文讨论的是非...
    NSO阅读 1,794评论 0 1
  • hq 监控,管理elasticsearch集群以及通过web界面来进行查询操作 项目地址:https://gith...
    小慕先森阅读 3,434评论 0 0
  • 20岁之前,我希望能遇到一个能让自己怦然心动的人,一个能让我在心中暗暗说“就是他了”的人,然后我一定会鼓起勇气、不...
    粗糙的外星人阅读 1,547评论 0 0