Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6351423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:00:16+00:00 2026-05-24T22:00:16+00:00

I have never made an API in objective-c, and need to do this now.

  • 0

I have never made an API in objective-c, and need to do this now.
The “idea” is that I build an API which can be implemented into other applications. Much like Flurry, only for other purposes.
When starting the API, an username, password and mode should be entered. The mode should either be LIVE or BETA (I guess this should be an NSString(?)), then afterwards is should be fine with [MyAPI doSomething:withThisObject]; ect.

So to start it [MyAPI username:@"Username" password:@"Password" mode:@"BETA"];

Can anyone help me out with some tutorials and pointer on how to learn this best?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:00:17+00:00Added an answer on May 24, 2026 at 10:00 pm

    It sounds like what you want to do is build a static library. This is a compiled .a file containing object code that you’ll distribute to a client along with a header file containing the interface. This post is a little outdated but has some good starting points. Or, if you don’t mind giving away your source code, you could just deliver a collection of source files to your client.

    In terms of developing the API itself, it should be very similar to the way you’d design interfaces and implementations of Objective-C objects in your own apps. You’ll have a MyAPI class with functions for initialization, destruction, and all the functionality you want. You could also have multiple classes with different functionality if the interface is complex. Because you’ve capitalized MyAPI in your code snippet, it looks like you want to use it by calling the class rather than an instance of the class – which is a great strategy if you think you’ll only ever need one instance. To accomplish this you can use the singleton pattern.

    Because you’ve used a username and password, I imagine your API will interface with the web internally. I’ve found parsing JSON to be very straightforward in Objective-C – it’s easy to send requests and get information from a server.

    Personally I would use an enum of unsigned ints rather than a NSString just because it simplifies comparisons and such. So you could do something like:

    enum {
        MYAPI_MODE_BETA,
        MYAPI_MODE_LIVE,
        NUM_MYAPI_MODES
    };
    

    And then call:

    [MyAPI username:@"Username" password:@"Password" mode:MYAPI_MODE_BETA];
    

    Also makes it easy to check if they’ve supplied a valid mode. (Must be less than NUM_MYAPI_MODES.)

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have never made a blog before. I am proficient with html and css.
I've made my share of 2D games on various platforms but I have never
Heavy emphasis on simple. I've never made an installer and I'd rather not have
I have never worked with web services and rails, and obviously this is something
I have never seen a way to do this nicely, i would be interested
I have never made an app using XCode and Cocoa but I think following
For all the ETLs I have written so far, I have never made them
I have some code that does something like this (Irrelevant bits snipped): void foo(Bitmap
I have never used nullable types in my C# code. Now I have decided
I have made connection with sql server but i have never done a connection

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.