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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:09:25+00:00 2026-05-17T03:09:25+00:00

i m making an iphone app that displays data from a website on a

  • 0

i m making an iphone app that displays data from a website on a table view .basically i m atoring the website’s data in an array and then display it on a table. now i want whenever the website update their data the user get the date when the data was updated .can anybody tell some different ways to do it?

  • 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-17T03:09:26+00:00Added an answer on May 17, 2026 at 3:09 am

    So, are you storing (caching) the website’s data on the phone and only updating once in a while, or are to loading the website and populating the table every time the app starts?

    If you are not storing it (with Core Data, User Defaults, NSKeyedArchiver, etc.) it will be difficult for how can you tell that the data has changed?

    In that case (not storing) you could after having pulled the data from the website generate the hash value of the data and store it using NSUserDefaults along with a NSDate.

    The next time you pull the information from the website you will generate the hash again and compare it to the previous value. If they match, then the content was not updated, else it was and you store the new hash value and the current date.

    If you have control over the website you can do a couple of things.

    1. Return a HTTP header with information about when the website was last updated and compare it with a date stored locally. This will allow you to use the HEAD HTTP semantic to check if a full GET request is needed allowing you to minimize network access.

    2. Implement push notifications (does seem over-kill for your situation) telling the user that the content was updated.

    Best of luck.

    UPDATE

    So your best bet would be calling [myArray hash] and store it in NSUserDefaults, e.g.

    NSUInteger hashValue = [myArray hash];
    NSDate *now = [NSDate now];
    
    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
    [prefs setObject:hashValue forKey:@"hash"];
    [prefs setObject:now forKey:@"date"]; // Maybe you have to convert the date to a string.
    [prefs synchronize];
    

    And later load it when the app starts (or becomes active):

    // Load the website again and generate the hash.
    NSUInteger newHashValue = [myArray hash];
    
    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
    NSUInteger *oldHashValue = [prefs stringForKey:@"hash"];
    
    NSDate *contentDate;
    
    if (newHashValue == oldHashValue)
    {
        contentDate = [prefs dateForKey:@"date"];
    }
    else
    {
        contentDate = [NSDate now];
    
        // Store the new date.
        // and the new hash.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.