plist question

Discussion in 'iOS Programming' started by tiltem, Oct 24, 2010.

  1. macrumors newbie

    Joined:
    Oct 18, 2010
    #1
    I am writing a simple rss reader and want to store the url in the plist file. I am first not sure of how and when i should add the url to the plist.

    Second once in there I am not sure how to retrieve the url from the plist to send to the xmlParser.

    Help with these two things is much appreciated
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Which plist file? You have to realize there can be more than one.
     
  3. thread starter macrumors newbie

    Joined:
    Oct 18, 2010
    #3
    pretty new to this, so i am guessing the info.plist file. I would like to be able to set the url in this file and then when parsing call the the variable in the file instead of hard coding the url in .m file. Have not done a lot of modifying of plist files.
     
  4. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    info.plist is part of the app bundle and you cannot modify it from within your app. Sounds like you probably should look into using NSUserDefaults instead.
     
  5. thread starter macrumors newbie

    Joined:
    Oct 18, 2010
    #5
    Hey Dejo-
    Thanks for the help! I got around what I wanted to do by adding the value into the info.plist and then accessing with:

    [[NSBundle mainBundle] objectForInfoDictionaryKey:mad:"RSSURL"]

    not sure if this is correct but it worked :)
     
  6. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    So, you have a single hardcoded URL that the end user is never going to change?
     
  7. thread starter macrumors newbie

    Joined:
    Oct 18, 2010
    #7
    Yes, for now that is fine.
    I found out how to add other plists and add and pull from them too.

    Now I am wanting to filter through the rss items that have links and cache them so they can be viewed when offline. Any idea how this is done? I have been reading on NSURLConnection and NSURLRequest and NSURLCache, but can not figure out how they all fit together, and what should be done to store the pages for offline viewing.

    Any suggestions would be great!! Thanks.
     
  8. thread starter macrumors newbie

    Joined:
    Oct 18, 2010
    #8
    Got it figured out. Used the URLCache sample from apple to figure out the caching. Thanks again for your help!!
     

Share This Page