Object-C , try to save file for different views, but seems not working -- MACnewbie:)

Discussion in 'Mac Programming' started by nickyu, Jun 13, 2008.

  1. nickyu macrumors newbie

    Jun 13, 2008
    I am new to obj-c programming/iphone, so I am probably missing something.
    I am making a simple xml feed reader, which has AppDelegate, ListViewController, DetailViewController (other parts are not important so left out for simplicity).
    - AppDelegate gets the XML from a URL, Parse the content into an NSMutableArray. WriteToFile.
    - ListViewController recover the array using dataWithContentOfFile, populate the list view
    - When use click on a item, then it brings to detail view.
    DetailViewController recover the array using dataWithContentOfFile, get the selected Data, display.

    What I could not figure out is that: the data can not be recovered from ListViewController, or DetailViewController, or maybe it didn't get saved at the first place. Since it is running with iphone simulator, I don't know if there is anyway to check if the file being created at the first place.

    Thanks in advance
  2. HawaiiMacAddict macrumors 6502a

    Dec 28, 2006
    On one of my Macs of course
    Aloha nickyu,

    I'm just starting out myself with Obj-C and Xcode. As such, I haven't attempted an iPhone app, but one thing I do with the apps I've written thus far is to use the Console and insert NSLog statements to indicate success (or lack thereof) of certain parts of my code. I don't know if that option is available to you, but if so, you could use the log to indicate whether or not the data has been saved.

  3. nickyu thread starter macrumors newbie

    Jun 13, 2008
    Re: HawaiiMacAddict

    Thanks for the NSLog hint. I will check that out tonight :)

Share This Page