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 8999905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:14:32+00:00 2026-06-16T00:14:32+00:00

I am trying to understand how the AFNetworking Framework works. But there is little

  • 0

I am trying to understand how the AFNetworking Framework works. But there is little detail I do not understand.

I wrote a subclass of AFHTTPclient than made it a singleton class and added a Initializer that does the following :

- (id)initWithBaseURL:(NSURL *)url {
    self = [super initWithBaseURL:url];
    if (self) {
        [self registerHTTPOperationClass:[AFJSONRequestOperation class]];
    }
    return self;
}

I got this code from a tutorial I found on the internet, but I do not understand why I have to register my class for JSONRequestOperation if I want to get JSON Data back? What exactly happens under the hood if I am doing so? What does the registerHTTPOperation class exactly do?

PS: Is there a good documentation with examples and in-depth explanations of AFNetworking somewhere on the internet?

  • 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-06-16T00:14:33+00:00Added an answer on June 16, 2026 at 12:14 am

    The registerHTTPOperationClass: on AFHTTPclient will use the class set to handle you request when using the getPath and postPath methods.

    In your given example, the HTTPRequestOperation is set the the AFJSONRequestOperation, which means that all request to the server will be done with an instance of AFJSONRequestOperation. The AFJSONRequestOperation will try and parse the result from the server with the NSJSONSerialization class.

    If you server responds with XML you should set the HTTPRequestOperation to AFXMLRequestOperation for example.

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

Sidebar

Related Questions

Im trying to understand how boolean logic works when I use NOT. To give
Trying to understand when implementation of IDisposable is necessary: I wrote a little example.
Trying to understand the options for will_paginate's paginate method: :page — REQUIRED, but defaults
I am trying understand how multi queries work in mysqli. But I confess that
Trying to understand a little more about Crockford's approach to Prototypical Inheritance whereby he
After trying to understand why client code is not rendered in a page (injected
I'm trying understand how try ... catch construction works in T-SQL. So I've read
Trying to understand the behaviour of pointers in C, I was a little surprised
Trying to understand how CoffeeScript instance and class variable works I came with this
trying to understand how validation works in playframework1.2.4,I went through the docs and also

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.