views:

25

answers:

2

showDescriptionPath is being passed from the previous Tableview. The text shows up, but the entire path prints in the UITextField instead of just the value of "Description" in my plist.

NSString *DescriptionPath = [[NSBundle mainBundle] bundlePath];
NSString *DescriptionInfoPath = [DescriptionPath stringByAppendingPathComponent:showDescriptionInfo];
showDescription.text = [[NSString alloc] initWithFormat:@"%@",DescriptionInfoPath];
+1  A: 

That's because you're not trying to load a value at all. The code you posted above will only show the path of what you're trying to load.

You can init a dictionary and get a value by using:

NSDictionary * myDict = [[NSDictionary alloc] initWithContentsOfFile:DescriptionInfoPath];
NSString * theValue = [myDict valueForKey:@"theKey"];
showDescription.text = theValue;
[myDict release];

Hope that helps

Tom Irving
A: 

Hi !

I'm beginner and I try to understand... HOW I can make a request to show all data (from plist) in SAME category (NOT ALL !) for exemple : show only the movie have : genre = Action

Please help me ... Thanks a lot ! Excuse my bad english !

Is it in this code I must make it or an other ???

  • (id)initWithLibraryName:(NSString *)libraryName { if (self = [super init]) { libraryPlist = libraryName; libraryContent = [[NSArray alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:libraryPlist ofType:@"plist"]];
Fraise