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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:57:32+00:00 2026-05-26T03:57:32+00:00

So let’s see if I can write a clear enough description of my problem…

  • 0

So let’s see if I can write a clear enough description of my problem…

I’m developing an application for a museum, where the user can find artworks either through an id or by scanning a qr tag…
Once either an id is entered or a tag scanned, the application sends the user from the search view, to the info view.
The info view gathers information about the artwork from an SQLite database…

My problem is, that in the info view, I call the function from the database class as such:

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSArray *paintingInfo = [[PaintingDatabase database] findPaintingByID];

    (additional code)
}

And I have no problem getting the info… works fine…
But my problem is, that if I go back to the search view and enter a new id or scan a new tag, the call/search isn’t run again, since the view is still in memory…

So, how would I go about running

NSArray *paintingInfo = [[PaintingDatabase database] findPaintingByID];

every time I enter the view…?

I’ve tried placing it in viewDidAppear instead, but I get an EXC_BAD_ACCESS error…

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

    I think you are close to answering your own question. Since viewDidLoad only gets called when your view loads, if you are using the same ViewController you will not get the results you are looking for. One option may be to destroy and create a new ViewController each time. This probably would be acceptable, performance-wise. Another option (that you seem to have explored) is to put your code in viewWillAppear. I would probably look into this more, and figure out what is causing your crash.

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

Sidebar

Related Questions

Let's say I have an facebook application running using the JS SDK. First user
Let me first describe the problem. I have this application that opens a word
Let's say I'm building a data access layer for an application. Typically I have
Let's say I can call a method like this: core::get() . What is the
Let's say I have this code: <p dataname=description> Hello this is a description. <a
Let's assume that a user votes for some movies in a scale of 1
Let's take a common example how a haskell function can be called from a
Let's suppose I have a Discussion model, and that a discussion can be tagged.
Let's say I have a dataset, which can be neatly classified using weka's J48
Let's say I'm writing a Windows Forms (.NET Framework 3.5) application which shows the

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.