Note that there are some explanatory texts on larger screens.

plurals
  1. PORead from plist insted of Code array
    primarykey
    data
    text
    <p>am Using <a href="http://www.iphonesdkarticles.com/2009/01/uitableview-searching-table-view.html" rel="nofollow noreferrer">UITableView - Searching table view</a></p> <p>its really nice easy tutorial but i really have bad time try to read from plist</p> <p>that what i did change </p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; //Initialize the array. listOfItems = [[NSMutableArray alloc] init]; TableViewAppDelegate *AppDelegate = (TableViewAppDelegate *)[[UIApplication sharedApplication] delegate]; listOfItems = [AppDelegate.data objectForKey:@"Countries"]; //Initialize the copy array. copyListOfItems = [[NSMutableArray alloc] init]; //Set the title self.navigationItem.title = @"Countries"; //Add the search bar self.tableView.tableHeaderView = searchBar; searchBar.autocorrectionType = UITextAutocorrectionTypeNo; searching = NO; letUserSelectRow = YES; </code></pre> <p>}</p> <p>and This How i read plist from My AppDelegate.m</p> <pre><code>- (void)applicationDidFinishLaunching:(UIApplication *)application { NSString *Path = [[NSBundle mainBundle] bundlePath]; NSString *DataPath = [Path stringByAppendingPathComponent:@"Data.plist"]; NSDictionary *tempDict = [[NSDictionary alloc] initWithContentsOfFile:DataPath]; self.data = tempDict; [tempDict release]; // Configure and show the window [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; </code></pre> <p>}</p> <p>and this my plist </p> <pre><code> &lt;plist version="1.0"&gt; &lt;dict&gt; &lt;key&gt;Countries&lt;/key&gt; &lt;array&gt; &lt;array&gt; &lt;string&gt;USA&lt;/string&gt; &lt;/array&gt; &lt;array&gt; &lt;string&gt;UK&lt;/string&gt; &lt;/array&gt; &lt;/array&gt; &lt;/dict&gt; &lt;/plist&gt; </code></pre> <p>and i get this error</p> <p><strong>* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*</strong> -[NSCFArray objectForKey:]: unrecognized selector sent to instance 0xe09120'</p> <p>help please am stock with this</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload