I want to create \"UrlPaths.plist\" file in my Application and also a dictionary with 4 or 5 objects. Please help me create a plist file and dictionary. And also read data f
We can get simple understanding about plist as below
Now you can read this data as below
NSString *path = [[NSBundle mainBundle] pathForResource:@"Priority" ofType:@"plist"];
NSDictionary *dictPri = [NSDictionary dictionaryWithContentsOfFile:path];//mm
NSMutableArray *arrMarkets=[[NSMutableArray alloc] initWithArray:[dictPri valueForKey:@"List"]];
NSMutableArray *arrForTable=[[NSMutableArray alloc] init];
NSMutableArray *arrForTable1=[[NSMutableArray alloc] init];
for (NSDictionary *dict in arrMarkets)
{
NSString *strS1=nil;
strS1= [NSString stringWithFormat:@"%@",[dict valueForKey:@"Description"] ];
[arrForTable addObject:strS1];
}
NSLog(@"%@----------------- ",[arrForTable description]);
for (NSDictionary *dict in arrMarkets)
{
NSString *strS2=nil;
strS2= [NSString stringWithFormat:@"%@",[dict valueForKey:@"Name"] ];
[arrForTable1 addObject:strS2];
}
NSLog(@"%@----------------- ",[arrForTable1 description]);