How I can delete a JSON data from NSMutableArray that comes from the server.
var jsondata : NSMutableArray!
func retrieve(){
let requrl: NSURL = NSURL(string: "http://localhost/tara/forvbc.php")!
let dataurl = NSData(contentsOfURL: requrl)
jsondata = try! NSJSONSerialization.JSONObjectWithData(dataurl!, options: .MutableContainers) as! NSMutableArray
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = thview.dequeueReusableCellWithIdentifier("thecell", forIndexPath: indexPath) as UITableViewCell
let asdasd = jsondata[indexPath.row]\
cell.textLabel?.text = jsondata["name"] as? String
return cell
}
I like to delete it using commitEditingStyle
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == .Delete{
}
}
Thankyou for your cooperation.