1

i have a array with data,i want to load the dictiionary type element with array......

NSArray *thisArray = [[NSArray alloc] initWithContentsOfFile:path];
    NSSdictionary *state;

how to load the content with array....

any help appreciated...

Linux world
  • 3,750
  • 11
  • 44
  • 59
  • 1
    Tell us what it is you're trying to do. Your question makes no sense. You want to put an array into a dictionary and persist it to a file? You want to load the contents of a file into an array? what? – jer Oct 29 '10 at 17:20
  • i have a xml content in the file i am loading that data to array – Linux world Oct 29 '10 at 17:38
  • i want to load the data to dictionary but when i was try to load is giving null – Linux world Oct 29 '10 at 17:39

1 Answers1

1

The usual pitfall is getting the path right for the file, other than that it is pretty straight forward... if I understand the question correctly

NSString* path = [[NSBundle mainBundle]pathForResource:@"someDataFile" ofType:@"plist"];
NSDictionary *state = [[NSDictionary alloc]initWithContentsOfFile:path]; 
Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80