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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:15:26+00:00 2026-05-27T07:15:26+00:00

Usually that really sounds like an sbolutely simple task: I have a view and

  • 0

Usually that really sounds like an sbolutely simple task: I have a view and I want to reload its data after it was changes in another view. But: It is not a UITableView and I didn’t use InterfaceBuilde, the view is created programmatically. The values that are displayed in the TextFields are held in a NSDictionary. In the other view, the key for the value to be displayed is changed, so I’d like to view the new value if the view is back again. So, here is my code:

- (void)loadView 
{
...
NSMutableDictionary *selection = [[ValueDispatcher dispatcher] selectionIndex];
NSDictionary *labels = [[ValueDispatcher dispatcher] labelDic];    
NSDictionary *values = [[ValueDispatcher dispatcher] valDic];

NSEnumerator *theKeys = [labels keyEnumerator];
while (key = [theKeys nextObject])
{
    CGRect frame = CGRectMake(10, i, 300, 30 );
    UILabel *label = [[UILabel alloc] initWithFrame:frame];
    [label setText:[labels objectForKey:key]];
    [[self view] addSubview:label];

    CGRect fieldFrame = CGRectMake(10, i + 40, 300, 30 );
    textField = [[UITextField alloc] initWithFrame:fieldFrame];

    [textField setText:[[values objectForKey:key] objectForKey:[selection objectForKey:key]]];
    [[self view] addSubview:textField];
}
    ....

when my view is back the old values ist still displayes and nothing changed. Which method should I use? I already tried reloadInputViews but it didn’t work, other methods I know only (reloadData) only work for a TableView…

  • 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-27T07:15:26+00:00Added an answer on May 27, 2026 at 7:15 am

    In case that view is hidden/pushed/off-screen while changing the values and becomes visible afterwards through e.g. popping from the navigation stack, you may consider using viewWillAppear:animated: for updating your fields. In any case, you should decouple the updating and the view creation.

    That is, in loadView, just create those views and in another method (e.g. updateData), update their displayed data. For holding a reference to those subviews, you could either use tags or proper instance variables within your viewController.

    Within the loadView you could manually invoke updateData as well as in viewWillAppear:animated:.

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

Sidebar

Related Questions

I have a number of functions that parse data from files, usually returning a
I have a site that usually has news items at the top of the
I have an application that usually is hosted on a Windows 2003 Apache Tomcat
In my asp.net-mvc website I have a field that usually has a string (from
I would like to read a little more about the + that is usually
I have a winforms application that doesn't really have a main form - it's
One of the things that I really like in Windows API is overlapped I/O.
I have some Ant tasks in my Eclipse JDT project that I want to
I have a .NET 3.5 server application that usually has about 8 clients. I'm
Why should I use #' together with lambda? It is usually written that way,

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.