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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:05:54+00:00 2026-06-05T20:05:54+00:00

So far I have only been updated a view from within its controller. I

  • 0

So far I have only been updated a view from within its controller. I am now in a different situation where I need to update an element in a view (a text label) based on some event occurring in another class C of my application. I realize this is basic but I am unclear what is the proper way to handle this.

  • Should I be passing my view controller in the init method of C? (Seems cumbersome to be passing in the view controller whenever I init that class C. Would require a bunch of refactoring too.)

  • Should I retrieve the app delegate from within C by calling [[UIApplication sharedApplication] delegate] and from the app delegate retrieve the view controller that I need?

Neither approaches strike me as practical or elegant.

Is there a better way?

  • 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-05T20:05:55+00:00Added an answer on June 5, 2026 at 8:05 pm

    The two most common methods are delegate and notification.

    In one case you give class C a delegate property and set that to be the view controller. To make it look good, you can define a delegate protocol similar to what’s done for a lot of API classes. It could be passed in init but it’s standard to just set the property directly.

    The other way is to have the view controller listen for a notification that class C sends when the event occurs. The view controller then makes the update when it receives notification.

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

Sidebar

Related Questions

So far the only way I have been able to keep index.yaml updated when
I'm trying to delete a row from my table view and so far have
I have an on update trigger in SQL Server 2008. I only need to
So far I have been creating Web Portal but recently I had a request
So far i have an assembly script that lets you boot from it and
I have recently downloaded itrade , and so far I have been unable to
I have a table in mnesia and I need to update individual fields in
I've been working on a system where you can create-read-update-delete to/from a table in
So far I have been using PDO->bindParam however while reading the manual I found
So far I have managed to write some code that should print the source

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.