ios - UITableView Sections via UILocalized​Indexed​Collation Delete -



ios - UITableView Sections via UILocalized​Indexed​Collation Delete -

i have sections working in tableview this guide

however, method requires maintain 2 arrays.

so when delete object table, have delete source array well.

the simple set same guide linked about,

summary:

data array - simple array of objects sections array - array 2d sections

the tableview utilize sections array populate itself, info array repopulates sections array required.

this delete set up, works.

override func tableview(tableview: uitableview, commiteditingstyle editingstyle: uitableviewcelleditingstyle, forrowatindexpath indexpath: nsindexpath) { if editingstyle == .delete { //println( "\(sections[indexpath.section][indexpath.row].name)" ) var finditeminobjectsarray = sections[indexpath.section][indexpath.row] (index, element) in enumerate(objects) { if finditeminobjectsarray === element { sections[indexpath.section].removeatindex(indexpath.row) objects.removeatindex(index) println("deletes") break } } tableview.deleterowsatindexpaths([indexpath], withrowanimation: .fade) }

my questions are

is bad design ? know of improve solution sectioning out tableview (like contacts list - alphabetically)

is there improve way sorted tableview, ie add together info actual objects ?

thanks

ios uitableview sections uilocalizedcollation

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -