iPhone ASIHTTP - Distinguishing between API calls?

后端 未结 4 1443
故里飘歌
故里飘歌 2021-02-06 14:07

I currently have a view controller that implements ASIHTTP for handling API calls.

My view controller fires 2 separate calls. I need to be able to distinguish between t

4条回答
  •  孤城傲影
    2021-02-06 14:26

    You can check the url/originalUrl properties OR you can subclass it and add your own property to indicate the call how I do it because it is easier/faster to compare ints than strings.

    i.e.

    myRequest.callType = FACEBOOK_LOGIN;
    

    I have all the calls in an enum like this:

    enum calls {
    FACEBOOK_LOGIN = 101,
    FACEBOOK_GETWALL = 102,
    ...
    }
    

提交回复
热议问题