Friday 15 May 2015

ios - Adding section and index list with custom cell, searchdisplaycontroller -


I have created a UITableView with custom code; Archived names, no, these cells have pincode.

My code for array here: -

  for (int i = 0; i & lt; [tempArr count]; I ++) {NSString * RawData = [tempArr ObjectAddindex: i]; If (raw data! = Zero) {individuals * newpros = [[person alloted] init]; NSArray * Data = [Raw Data Component Separated Bettering: @ "\ t"]; NewPerson.name = [NSString stringWithFormat: @ "% @", [Data ObjectTitaxx: 0]]; NewPerson.no = [[Data ObjectTitx: 1] Integer Value]; NewPerson.pincode = [[Data ObjectTitx: 2] Integer Value]; [All Parson adobject: Nupeter]; }}  

This is my Customcell.h

  @ interface Kstmsel: UITableViewCell @property (weak) person * person; UITableView Datasrouce method: -  
  - (UITableViewCell *) Talikadrishy: (UITableView *) Table View Selforruatindappath: (NSIndexPath *) Suckankpth {Kstmsel * cell = [tblStations dequeueReusableCellWithIdentifier: @ "personCell"]; If (tabular view == self .searchDisplayController.searchResultsTableView) {cell.person = filteredContentList [indexPath.row]; [Cell.textLabel setText: cell.person.name]; } And {cell.person = allPersons [indexPath.row]; [Cell.textLabel setText: cell.person.name]; } Return cell; }  

How do I stream & amp; Index list for all names of J & amp; A; Title from Cell.textLabel.text?

But it has a stable key & amp; Name to association , NSArray . has been added to.

In my example, I do not know how to get started in the name array starting from the same letter. I am also using UISearchDisplayController for the search person name.

I have the number of sections and amp; Name for those classes that are dynamically named in the title or cell.textLabel.text.

I do not know about UISearchDisplayController, these sections & amp; The index list will be displayed in the UISearchDisplayController, so I have these sections & amp; Pointer list during search.

You need to spend some more time in trying to make their questions more clearly.

Add the required UITableView is a custom implementation of the data source and delegate methods ...

Note My impression is that your variable allPersons a NSMutableArray .

Note that these are not included in the data sets of your search results!

Return a NSInteger to your UITableView ...

  - (NSInteger) numberOfSectionsInTableView the number of sections in: ( UITableView *) table view {NSSet * setData = zero; NSInteger integerData = 0; SetData = [NSSet set defers: allPersons]; Fulldata = [set data count]; Return full data; }  

UPDATE

Return a NSString for the section heading title ...

  - (NSString *) Table view: (UITableView *) Table view title ForHeaderInSection: (NSInteger) section {NSOrderedSet * setData = zero; NSString * stringData = Zero; SetData = [ordered by NSOrderedSetSat with Array: allPersons]; Stringdata = [[setData allObjects] componentsjointedbest string: @ ""]; Return string data; }  

... plus others if I have the time ...


No comments:

Post a Comment