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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:42:48+00:00 2026-06-01T19:42:48+00:00

I am new to iOS development, so I would appreciate some feedback. I am

  • 0

I am new to iOS development, so I would appreciate some feedback.

I am trying to build an iOS client for my web service. So far this is what I have done:

I am implementing two views (Utility-based app using Storyboard). In the main view, I use a text field and a search button, where the user can enter a query and then click the search button. Once the search button is clicked, my intention is to read the value of the text field, and use it in my Restful call to my web service. My web service replies back with a JSON file with the query results, which I parse and show to the secondary view’s text area.

I know how to do the restful call in iOS and how to do the JSON parsing as well as displaying the results on the screen (at least the text stuff, but that’s another different question). But my intention is to learn and implement MVC basics to my application.

According to MVC, the controller updates the view, and the model sends out a notification broadcast which the controller can listen to and know if there are any changes in the object. So this is what I would ideally like to do:

My Model – My model would handle the core RESTful call, get the JSON reply, parse it and get the resulting values that I want to display on the view.

My Controller – I would like my controller to listen to my model and obtain the resulting values from Model and display them on View.

Using a quick and dirty way, I can implement the RESTful call, JSON parsing and displaying resulting values – all inside the Controller, but with this technique, if my view changes tomorrow, then I have to re-write my code. Or if I want to add new features, then I have to change my controller. So ideally I would like to have a core Model that’s not aware of how View looks like, and just let’s the Controller take the results from Model and display them on View.

From what I have read from Google search results so far, two ways of doing this is by a) Key Value Observation and b) Notification center.

For last 2 days, I am trying to find a good decent way to implement Notification center or read more about it, I am not getting a good lead. Some of the questions I have is, can I send out the String results value using Notification center that my controller picks up? How does Notification Center really work with string values? Where can I find some good examples?

So any help regarding this will be very much appreciated.

  • 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-01T19:42:50+00:00Added an answer on June 1, 2026 at 7:42 pm

    Some of the questions I have is, can I send out the String results
    value using Notification center that my controller picks up?

    Yes, that would commonly done using the userInfo property of a NSNotification. userInfo is a plain NSDictionary that may contain instances of NSObject derived objects indexed by keys that are adhering to the NSCopying protocol (commonly NSString is used). Note that the dictionary (userInfo) will retain your parameter object/s.


    How does Notification Center really work with string values?

    Well, that depends on how you want it to work. But nitpicking aside, see below.


    Where can I find some good examples?

    Maybe this one helps…


    Example

    The receiver (controller) registers for the notification:

    - (void)registerForNotifications
    {
        [[NSNotificationCenter defaultCenter] addObserver:self 
                                                 selector:@selector(modelObjectUpdatedString:)
                                                     name:@"StringUpdated"
                                                   object:nil];
    }
    

    The sender (model) notifies the world:

    - (void)stringUpdateWith:(NSString *)theString
    {
        self.string = theString;
        [[[NSNotificationCenter defaultCenter] postNotificationName:@"StringUpdated" 
                                                             object:self 
                                                           userInfo:[NSDictionary dictionaryWithObjectsAndKeys:self.string, @"String", nil]];
    }
    

    The receiver (controller) receives the notification within its handler:

    - (void)modelObjectUpdatedString:(NSNotification *)notification
    {
        ModelObject *postingObject = [notification object];
        NSString *string = [[notification userInfo]
            objectForKey:@"String"];
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to iOS development, I just have UITableViewController in a storyboard. I would
I am new in ios development .Now i am trying to develop an ipad
I am new to iOS development and am trying to figure out how it
I am completely new to iOS development so I may be doing this wrong
Hello.Am new to ios development.What have to do for NSOpenPanel to work in the
First of all I have to say I am new to iOS development. My
I'm new to Android development, i'm trying to port an IOS app to Android.
i'm just new to iOS Programming, so appreciate for any help. I'm trying to
I'm new to IOS development, and I'm just trying to get my head around
Ok, I'm still pretty new to iOS development, so I apologize if this is

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.