Philippe Renaud
asked on
How to read a PLIST
Hi, please have a quick look here :
http://developer.apple.com/library/ios/#samplecode/TableViewUpdates/Introduction/Intro.html
in that source code, apple has a PLIST called PlaysAndQuotations
I have created a new plist within that same project and called it Test
I have changed the name of the argument in appDelegate where they create the NSUrl to go read the plist to Test
and nothing shows up (even if I have the same content of PlaysAndQuotations) how come ?? ..
http://developer.apple.com/library/ios/#samplecode/TableViewUpdates/Introduction/Intro.html
in that source code, apple has a PLIST called PlaysAndQuotations
I have created a new plist within that same project and called it Test
I have changed the name of the argument in appDelegate where they create the NSUrl to go read the plist to Test
and nothing shows up (even if I have the same content of PlaysAndQuotations) how come ?? ..
ASKER
What I meant is that it works fine If I run it but as soon as I create a new PLIST with another name and I change that line :
NSURL *url = [[NSBundle mainBundle] URLForResource:@"PlaysAndQ uotations" withExtension:@"plist"];
to :
NSURL *url = [[NSBundle mainBundle] URLForResource:@"Test" withExtension:@"plist"];
now I see nothing in the TableView... its the same url except a new name.. can u try ?
NSURL *url = [[NSBundle mainBundle] URLForResource:@"PlaysAndQ
to :
NSURL *url = [[NSBundle mainBundle] URLForResource:@"Test" withExtension:@"plist"];
now I see nothing in the TableView... its the same url except a new name.. can u try ?
can you please follow what I said above with your "Test". I think you are just making a simple mistake and stepping through the code will help to identify the problem.
ASKER
When I step after NSArray *playDictionariesArray = [[NSArray alloc ] initWithContentsOfURL:url] ;
playDictionariesArray is <nil>
looks like it does not find my PList in resources. But im not blind... it is in Resources... I see it in my project navigator
playDictionariesArray is <nil>
looks like it does not find my PList in resources. But im not blind... it is in Resources... I see it in my project navigator
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, yes it worked, very strange that with a new list i have problem but anyway .. thanks.
by the way, new question here regarding same subject :
https://www.experts-exchange.com/questions/27395019/how-do-have-multi-level-in-Table-View.html
by the way, new question here regarding same subject :
https://www.experts-exchange.com/questions/27395019/how-do-have-multi-level-in-Table-View.html
Open in new window
It sounds to me like you have a small typing error somewhere. If everything is like you say, step through your code and make sure that "url" in in fact an object, that you get a dictionaryobject with "playDictionariesArray " and you have a NSMutableArray with "playsArray"