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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:44:10+00:00 2026-06-11T13:44:10+00:00

I have the following code called with NSNotification center, i know its being called

  • 0

I have the following code called with NSNotification center, i know its being called because the array is appearing in the NSLog, but my label chipCount is not updating with the new value. Is there perhaps a method I applied wrong when extracting the string from the array?

-(NSString *) dataFilePath {
    NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentDirectory = [path objectAtIndex:0];
    return [documentDirectory stringByAppendingPathComponent:@"Chips.plist"];
}

-(void)readPlist {
    [self dataFilePath];
    NSString *filePath = [self dataFilePath];
    if([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
        chipArray = [[NSArray alloc] initWithContentsOfFile:filePath];
        NSLog(@"%@\n", chipArray);
        NSLog(@"%@\n", filePath);

        NSString *chipcountString = [chipArray objectAtIndex:0];
        chipsFloat = [chipcountString intValue];
        chipCount.text = [NSString stringWithFormat:@"%i", chipsFloat];
        //[arrayForPlist release];
    }
}
  • 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-11T13:44:12+00:00Added an answer on June 11, 2026 at 1:44 pm

    I think this is a multithread problem. Update UI must in the main thread. Maybe readPlist is
    executed in another thread.

    Try this code below, maybe it can help you:

    [self performSelectorOnMainThread:@selector(theProcess:) withObject:nil waitUntilDone:YES]; 
    
    - (void) theProcess:(id)sender
    {
    
        ....
    
        chipCount.text = [NSString stringWithFormat:@"%i", chipsFloat];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code, but why is the ProcessExited method never called? It is
I have the following line of code called very often: var configValue = System.Configuration.ConfigurationManager.AppSettings[ConfigValueKey];
I have the following bit of code in a method called by clicking the
I have a simple assembly code file called exit.s that looks like the following:
i have the following code in a module called code_database.py class Entry(): def enter_data(self):
I have following code: public class readSensorsData extends Activity implements SensorListener { /** Called
I have the following code that gets called after the view loads. It works
I have following code which have a css class called formErrorContent var promptContent =
I have following code: public class ShowActivity extends ListActivity implements OnItemClickListener { /** Called
I have the following code that is called when a button on an action

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.