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

  • Home
  • SEARCH
  • 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 253555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:46:18+00:00 2026-05-11T21:46:18+00:00

I am quite new to Cocoa and to iPhone programming. I am using the

  • 0

I am quite new to Cocoa and to iPhone programming.

I am using the Xcode Utility Application template to implement a simple app that has:

  • a view with a text field to collect a username
  • a view with a connect button to start a connection to a remote site using the
    username to get some data via HTTP. The data will be presented as a text string on the screen.

I think this represents my VIEW in the MVC pattern.

I created a simple class to store the username and to do all connection work that represents my MODEL and instantiated it inside the AppDelegate.

Here a really simplified sketch:

simplified sketch

It is not really clear to me how can I get data nested deep into subviews (username) or how can I trigger actions in nested parent views (connect button).

My question is:

What is the best/cleanest way to implement this architecture?

How do I implement the CONTROLLER?

Thanks in advance for any help,
Paull

  • 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-11T21:46:18+00:00Added an answer on May 11, 2026 at 9:46 pm

    Updating my answer based on comment:

    It’s in most cases ok to have state in your controller. Like an array or an instance of whatever modelobject you are writing an application for.

    I would keep the model object clean of any networking code and put that in the Controller instead though. In this case the ViewController where that connection action is triggered.

    Original answer:

    It is not really clear to me how can I
    get data nested deep into
    subviews(username) or how can I
    trigger actions in nested parent
    views(connect button).

    With the utility application template you already have a couple of ViewControllers.

    To get references to your UI inside your controllers you need to declare IBOutlets and connect them inside Interface Builder. To respond to actions you need to declare and implement IBActions in your ViewControllers and hook them up in Interface Builder as well. Which you do in Connections pane (2nd from left) in the inspector.

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

Sidebar

Related Questions

OK, I'm still quite new to Xcode/Cocoa etc, so please forgive me if this
I'm quite new to programming, and I was wondering if there is a good
First of all, I must say that I am quite new to the API
I've seen this quite a few times while using Office Interop classes this.CustomXMLParts.Add(MyResources.Data, new
I'm rather new to programming in Cocoa, but I've been working on learning the
Is there a distributed application framework (commercial is okay as well) that supports iPhone
Im quite new to stackoverflow so I dont know if this question has been
I am quite new all this iPhone stuff. I have no such clear IDea
I am working on quite complex app with huge sync procedure beetwen iphone and
Quite new to this but i have created a SQL script that groups by

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.