search

Home  >  Q&A  >  body text

objective-c - block变量怎么变为全局变量

外部有个全局变量self.array

dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);

dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
NSString *string=@"变量";

}
NSlog(@"%@",self.array); //此处self.array为空
请问下要怎么给self.array赋值呢?

巴扎黑巴扎黑2757 days ago392

reply all(0)I'll reply

No reply
  • Cancelreply