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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:14:46+00:00 2026-06-08T06:14:46+00:00

I have accounts which they have some settings attributes. As settings there are value

  • 0

I have accounts which they have some settings attributes. As settings there are value of UISlider and value of UISwitch. When i run the application it works fine i can display the last value from NSUserDefaults because viewDidLoad method works. My application has a tab bar controller by the way. So when i switch tabs it works fine too because i can get the values of switch and slider and update them in viewWillAppear method. But in my setting switch, i present a view which there are user list in it, so the user can select any account. When i get back from presented view i can’t update the values of switch and slider. I need a trigger method to update their values. Is there any way to do that?

  • 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-08T06:14:48+00:00Added an answer on June 8, 2026 at 6:14 am

    Yes this are the 3 apple ways to do it:

    1) Delegation
    2) NSNotificationCenter
    3) KVO
    

    However for your particular case a modal view, the delegation pattern is the one Apple recommends, and is the one I would recommend as well.

    It requires a bit more coding than the other 2 options though.

    First you have to declare the protocol in the view you are presenting modally:

    in your .h
    
    @protocol MyProtocol;
    
    @interface MyClass : NSObject
    
    @property (nonatomic, weak) id<MyProtocol> delegate;
    
    @end
    
    @protocol MyProtocol <NSObject>
    
    -(void)updateValues:(NSArray *)values;
    
    @end
    

    Then before presenting the modal view modally from the original view controller simply set the delgate like this

    myModallyPresentedController.delegate = self;
    

    Then have your presenting view controller adopt the protocol

    in your .h
    
    MyPresentingViewController : UIViewController <MyProtocol>
    
    in .m
    
    //Implement method:
    
    -(void)updateValues:(NSArray *)values {
       //Update Values.
    }
    

    Finally when user presses “Done”

    you can call

    [delegate updatedValues:myValues];
    

    And update accordingly.

    Hope that helps.

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

Sidebar

Related Questions

I have an application which will require a dynamic business rules engine. Some of
I have verious accounts which need to be kept track of. These accounts are
I have a program which reads Inbox messages from email accounts, as the title
Let's say I have an Account entity, and an AccountData entity (which stores some
We have an ASP.NET application that queues some of its long-running operations (generating reports,
I'm writing my first web application (still!), and have a problem activating user accounts.
I want to save email accounts and passwords, which I will have previously encrypted
I have Winforms application written in C# which connects to a SQL Server Database.
I have some templates stored in my pages view directory: Pages/settings/edit_account/ basic_info.html.erb relatives.html.erb contact.html.erb
I have multiple 1.5 GB CSV Files which contain billing information on multiple accounts

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.