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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:26:35+00:00 2026-05-12T06:26:35+00:00

Hey all, trying to learn objective-c. It was going quite well, until I realized

  • 0

Hey all, trying to learn objective-c. It was going quite well, until I realized I was missing a link.

When building in the spirit of MVC, I understand it as you Model and View should never talk to eachother.

I have this problem I’m messing around with now.

  • A model containing a polygon class.
    Contains an polygon object with
    attributes like numberOfSides.

  • A controller, reading some UI
    elements and modifying the model. For
    example numberOfSides.

  • A view, containing a view drawing
    polygons.

Now, this is where the trouble arose. The view needs information about the object from the model. How do I get that? I tried some IBOutlet, but never got it to work.

I ended up creating a property for the view which could contain numberOfSides. Then I would a controller method which would call a view method back and set the numberOfSides.

I hope some of you can clarify this a bit for me and tell me how you should go ahead with this.

Thanks a bunch and goodnight! 🙂

  • 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-12T06:26:35+00:00Added an answer on May 12, 2026 at 6:26 am

    MVC in Cocoa is slightly different than traditional MVC, so I’ll answer with the Cocoa way.

    You’ve got a controller object, which has a pointer to your Polygon object. Your controller should also have a pointer to your View (via an IBOutlet, most likely). As the polygon changes (whether numberOfSides or whatever), the controller needs to be aware of that and relay the information on to the view. Likewise, if the view is allowed to change the numberOfSides (say you have a slider to increase the number of sides), then the controller needs to be aware of that change and pass it to the Polygon object.

    Basically, the purpose of the controller is to pass information back and forth from the view to the model and make sure that they stay synchronized.

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

Sidebar

Related Questions

Hey all, i am trying to learn how to insert a comment within some
Hey all. Newbie question time. I'm trying to setup JMXQuery to connect to my
Hey all. We're sending quite a few emails (around 23k) using IIS6 SMTP service
Hey all I'm trying to do the following insert query SqlDataSource userQuizDataSource = new
Hey all i am trying to figiure out why my code is not triggering
Hey all i am trying to figure out how to go about calculating this
hey all i am trying to make a data output stream in php to
Hey everyone. While I'm trying to learn some PHP and mySQL, I ran into
Hey all i am trying to get my code below to work in order
Hey all, I'm currently trying to write a compile-time string encryption (using the words

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.