Home > Mobile >  Please comment in the ios AF to get data for external use only
Please comment in the ios AF to get data for external use only

Time:09-25

Want to use the AF outside access to data, global variables, because like asynchronous thread? Even if change inside or outside the initial value; The return value is not AF not return a value, the AF even outside the

CodePudding user response:

What time do you want to use, want to wait the download is complete, the ability to use, a global variable is also has a value only after the download is complete,

CodePudding user response:

] I was after the click of a button on the AF first to get the data, and then one of the JSON as other functions of other operating parameters, is displayed on the screen, so these things should be written in advance to program, write how to make the JSON
as parameters to other functions?

reference 1st floor wlflovesj response:
what time do you want to use, want to wait the download is complete, the ability to use, a global variable is also has a value only after the download is complete,

CodePudding user response:

Write a method, you can call in the download is complete, the json as parameters, or you can write a notice, in the notice to use global variables

CodePudding user response:

refer to the original poster crazy confused AGAR AGAR chicken reply:
want to use the AF outside access to data, global variables, because like asynchronous thread? Even if change inside or outside the initial value; The return value is not AF not return a value, the AF even outside the

Use the GCD semaphore dispatch_semaphore_t can be achieved
  •  Tags:  
  • iOS
  • Related