app not lauching from simulator

Discussion in 'iOS Programming' started by grandM, Dec 15, 2015.

  1. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #1
    Hi

    My app uses Core Data and works like a charm when I run it from Xcode. When I press the stop button the simulator goes back to the launch screen. Normally when I press the app icon the app launches. Now it just bounces back.

    Does anyone see a reason why?

    Thanks
     
  2. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #2
    Could be a lot of things. What have you tried to fix it? Does it still occur when you run it on a different type of iPhone in the simulator?
     
  3. Dookieman macrumors 6502

    Joined:
    Oct 12, 2009
    #3
    What does your console say? If you have made any changes to your Core Data Entities or attributes that could be a reason for the crash. Try deleting it from your home screen and reloading it.
     
  4. Mascots macrumors 65816

    Mascots

    Joined:
    Sep 5, 2009
    #4
    ^ I think it's that

    If you're not migrating your persistent store after a change, you will get a crash when it is loaded into the data model because it won't match.
     
  5. grandM thread starter macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #5
    I don't think so. I did change the entities but delete the app every time before running it in Xcode. Upon closing Xcode I try to re-run in the simulator, then it fails. Or must I keep Xcode running?
     
  6. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #6
    Unless you can give a lot more details it's very difficult to help you. This is one of those problems that could have a lot of causes. A lot of things have to go right in those first 1000 milliseconds after you tap an app icon.
     
  7. grandM thread starter macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #7
    I do not know what is going wrong. If I run the app from Xcode the simulator starts up and everything works. As the app uses Core Data I wanted to test it out. So I hit the stop button in Xcode. Then my simulator shows the app icons. I tap the app icon and I see a white screen appearing. Then it shifts back to the icon. Nothing more happens. I do not know how I can give more information as I'm not running it from Xcode at that moment?
     
  8. grandM thread starter macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #8
    I made progress. Apparently it has something the do with my cache. When I disable caching the problem disappears. Caching seems useful though. Can somebody explain me how to make caching work properly?
     
  9. grandM thread starter macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #9
    I put the caching back on but deleted the cache if the resultscontroller differs from nil. Does this make any sense?
    Code:
    var fetchedResultsController: NSFetchedResultsController {
    
            if_fetchedResultsController != nil {
    
                return_fetchedResultsController!
    
            }
    
           
    
            NSFetchedResultsController.deleteCacheWithName("Master")
    
     
  10. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #10
    Without knowing all the detail, I'll go out on a limb with a guess:

    Could it be that a thread is holding cache and/or waiting for a response?

    Is there some kind of flush command that should be called before closing a thread?

    If they have a cache, there should be something to indicate if there is something there or pending cleanup calls.
     
  11. grandM thread starter macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #11
    I'm using the splitviewcontroller template. This does indeed use a cache called Master in its NsFetchedResultController. I do set predicates and so on upon creation of the fetchedResultController but do not seem to set those elsewhere again. Hence I am a bit puzzled why it had a problem with the cache. Now I've solved it with the code above hence clearing the cache when the fetchedResultController is called upon. At that moment predicates and so on are set too.
     

Share This Page