Plist or property list are usually used for storing data in iPhone.
They are normal XML files, you can open it in a texteditor to view it’s data.
This sample code shows how to read data from the plist.
Reading a plist will return an array.You can print out the array to view the results.

     NSString *path= [[NSBundle mainBundle] pathForResource:@"plistName" ofType:@"plist"];
     BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:path];
         NSMutableArray *arr = [[NSArray alloc]  initWithContentsOfFile: path];
         NSLog(@"Data from plist %@",arr);
     }else {
        NSLog(@"File Not Found");
        exit(1);  // if file not found exit the application.

Please leave your valuable comments………


Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.