I am trying to do read a PLIST from URL to a NSMutableDictionary.
Code before
autos = [[NSMutableArray alloc] init];
[autos addObject:[[NSMutableDictionary alloc]initWithObjectsAndKeys:@"Auto 1", @"name", @"Auto.png", @"image", @"Klassiker", @"description" , nil]];
This works. But now I want to use a PLIST. And I am trying this, this way:
autos = [[NSMutableArray alloc]initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://dl.dropbox.com/u/9358444/auto.plist"]]];
Thanks.
PLIST http://dl.dropbox.com/u/9358444/auto.plist
Your property list contains a dictionary, but you're trying to use it to instantiate an array. Do this instead:
ReplyDeleteNSMutableDictionary *autos = [[NSMutableDictionary alloc] initWithContentsOfURL:
[NSURL urlWithString:@"http://dl.dropbox.com/u/9358444/auto.plist"]];
I'm new to the site, I'm still not sure how to add comments to the OP. Load it into a dictionary first then transfer it into a mutable array
ReplyDelete