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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:01:19+00:00 2026-05-22T20:01:19+00:00

To be more specific, I have an app that has multiple tableViews that drill

  • 0

To be more specific, I have an app that has multiple tableViews that drill down data to display an image in a detail view. When the detail view is displayed, the app adds this views image (its name) to an array of recently viewed images. The recently viewed images are displayed in a tableview in the first screen of the app.

The problem lies in the fact that the detail view is created by a tableView at the end of the line of a list of tableViews. The detail view is also created by the first tableView when a recent item is tapped on.

I tried to setup the first tableView as a delegate of the detail view, to receive notification that a new image has been displayed in the detail view. I realized it never calls the delegate methods when a new item is entered, since the detail view is being created somewhere else.

I think I need to rethink my app design and who should hold the data for the recently viewed images. I thought the first view should hold that data since it is the one displaying it, but I am at a bit of a loss on how to do this in a way that takes good code design into account. I can make it work with NSUserDefaults, but am not sure if this is really what it should be used for or if this is the best practice.

I appreciate any and all input.

Jamie

  • 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-22T20:01:20+00:00Added an answer on May 22, 2026 at 8:01 pm

    I would see a few solutions here:

    1) go ahead with NSUserDefaults, LRU (last recently used I guess) lists are often being save to user preferences, regardless if it is a good or bad design. If it doesn’t take to much space and works for you just go ahead.

    2) make a common context for LRU, possibly using a singleton, that would be accessible from all over the application, put your images there and get them back any time you need them. Actually you could make its interface using class methods and not bother making it real singleton. Class methods represent a nice static context that is easily accessible. In ObjC they even can be overridden! Which is kind of cool compared to Java.

    3) use a factory pattern to create views: there is one factory class that know the delegate, creating new views would be again implemented using class methods: each create method would the set the one known delegate to each view regardless of the point of creation.

    4) now this one is really overkill but very very “un-coupled”: send notifications with recently used images. Those that are interested in knowing them would register themselves are observers and, well, get the images…

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

Sidebar

Related Questions

I have an app that will have entries of both varchar(max) and varbinary(max) data
I am working on a core data app with three20. I have a specific
Unfortunately, the problem is not more specific than that. I've found a few examples
I have a situation that has been partially covered by other answers at SO,
I was wondering if someone has already solved this. I have a SpringMVC app
I have several message queues that have specific messages on them. I've created classes
I've been using mySQL for an app for some time, and the more data
Ive got an app that allows users to listen to music. Each artist has
I'm not really asking about how programmers learn how to program. More about specific
I'm hearing more and more about domain specific languages being thrown about and how

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.