Resolved [Table Views] Is anyone experiencing problems after the 4.2 and iOS 5 updates?

Discussion in 'iOS Programming' started by CodeBreaker, Oct 18, 2011.

  1. CodeBreaker, Oct 18, 2011
    Last edited: Oct 19, 2011

    CodeBreaker macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #1
    Hi, I have an navigation app I created which is similar to the "Locations" example in the documentation. My app was working fine on Xcode 4.1/iOS 4.3.
    But since the 4.2 update, it crashes with the following message:
    Code:
    Invalid table view update.  The application has requested an update to the table view that is inconsistent with the state provided by the data source.
    The Locations example too crashes with the same error. Any ideas?

    I have just installed the updates, didn't change any of my apps.
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    I haven't seen this but it's likely to occur inside a beginUpdates/endUpdates block if there is some inconsistency between the number of rows and sections reported by your callbacks and the adds/deletes that you do inside the beginUpdates/endUpdates block.

    If it's not occurring there then you should try to figure out what method causes the error and log the output from the number of rows and sections callbacks.
     
  3. CodeBreaker thread starter macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #3
    Thanks for your help :). Logging always helps. I fixed it and I'm quite embarrassed to talk about it. :eek: But still:

    I am using Core Data for persistence. In my app, I store all the CoreData model objects in an array, in the usual form: perform fetch when the app loads and save context when changes are made.

    I was half way through the app, and was just figuring out saving the context after an UI action. The problem was I never initialised my array in viewDidLoad, as I was going to populate it from the Core Data store later on. A simple alloc-init fixed it.
    So, well, I suck :(
     
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    Just be one of those people who never makes the same mistake twice.
     
  5. CodeBreaker thread starter macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #5
    I try hard but these things still happen -- uninitialised stuff, unnecessary releases, local declarations <-> ivars and other hiccups. ;) I'm actually just 2 months in iOS. Maybe I'll solve others problems in another couple of months :)
     

Share This Page