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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:38:14+00:00 2026-06-15T11:38:14+00:00

I have an application which have UIScrollView with Paging .. and it has arrays

  • 0

I have an application which have UIScrollView with Paging .. and it has arrays with images .. What I want to do is saving which array has been viewed last time the app was running and when I open the app again it should show the last array has been viewed.

Thanks in advance!

  • 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-15T11:38:16+00:00Added an answer on June 15, 2026 at 11:38 am

    Tie your array saving code to the UIApplicationDidEnterBackgroundNotification notification, and then tie your loading code to the UIApplicationDidBecomeActiveNotification notification.

    You can also use the appropriate protocol methods in UIApplicationDelegate.

    …rereading the question — are you looking for help on how to save something or how to trigger saving at the right time?

    Edit

    It looks like you’re already following a tutorial with Ray Wenderlich, but I’ll just make a plug for one that I found incredibly simple when I was starting out: http://cocoadevcentral.com/

    In terms of saving things to disk, you’ve got several options, the easiest of which is probably to use the NSUserDefaults as another user noted. It’s a dictionary (key : value) system, so you can store your array/image/pathToTheImage, etc. by a name of your choosing, i.e.

    “LastImageViewed” : UIImage <–(object) and then load it back by the same name.

     // MyAppDelegate.m
     - (void)applicationDidEnterBackground:(UIApplication *)application {
    
          // Save
          [[NSUserDefaults standardUserDefaults] setObject:YOUR_ARRAY_GOES_HERE forKey:@"A_NAME_YOU_CHOOSE"];
          [[NSUserDefaults standardUserDefaults] synchronize];
    
     }
    
     ...
    
     - (void)applicationWillEnterForeground:(UIApplication *)application {
    
          // Load
          NSArray *firstArrayToOpen = [[NSUserDefaults standardUserDefaults] objectForKey:@"THE_NAME_YOU_CHOSE"];
    
          // Do your thing...
     }
    

    Here’s the reference for the NSUserDefaults class: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html

    and the above mentioned notifications and methods reference:
    http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UIApplicationDelegate

    Does that help?

    • 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 has a fullscreen UIScrollView, and within it there are
I have an application which is packaged as a .war file. It has GWT
I currently have a UIScrollView which has a content size equal to about 50
I have an application which needs to display around 50 images saved in the
I have application which connects to server via RestClient. And I want to implement
I have application in which check-box tree is present. I want to pre-populate the
I have application which is working best with Wifi,3G.. Now what i want is
I have application which has some networking code which runs asynchronously. I have attached
I have an application which has several buttons, for these I use different drawable
I have an application which updates my datagrid each time a log file that

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.