views:

58

answers:

2

Hi all,

I am implementing a application based on web services. In that I need to add a string as property in .plist and I need to get the value from the .plist whenever I need in the code. Can you guys please help me on this?. It is a very urgent requirement for me.

Thanks in advance, Sekhar Bethalam.

A: 

Here is a code sample:

NSString *path = [[NSBundle mainBundle] pathForResource: @"YourPLIST" ofType: @"plist"]; 
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile: path];
id obj = [dict objectForKey: @"YourKey"];
jv42
Hi I got the path null can you please help me
sekhar
Your plist file must be added to the project, then you must set its exact name (including case) in the code above.
jv42
A: 

See this link.Hope this will be very helpful for you.

All the best.

Warrior