how to call an api in xcode

Hi I'm new at developing, I want to learn how to call an api in xcode but deal with an error in the view controller. 

the error tells 'cannot find xxxx in scope'. I know that I didn't define that xxxx anywhere but I don't know where should I put it. please help me by giving some example about calling an api in xcode or some information about how to call an api in xcode.

Replies

Hi, what is the value of xxxx in this case? You are likely missing an import statement, and you need to know which framework the API is in so you can import the right one.

It may not be an API issue, just that you have an undefined var.

Cmd-click on '***x' and ask to jump to definition. Or just search for it to see if it is defined somewhere.

If not found, you are missing a declaration:

var xxxx : sometype = somevalue

at the that fo the class code

Note: I don't think xxxx is such a secret term, you'd better give precise information :

  • name it
  • show the code where you get error.

Otherwise, there is too much guessing.