xcode6 - Append result to datasource with swift -


i'm using promise result fill data source , update table view data.

i have declared:

var tdatasource: [friendresponser]? //contains de result previous bind      var datasource: [friendresponser]? { //this total result after append         didset {             self.tableview.reloaddata()         }     } 

but, when try append result with:

promise.then { user in             self.tdatasource = user             datasource?.append(tdatasource?)             //self.datasource = user             }.catch{                 error in                 sclalertview().showerror("error", subtitle: error.localizeddescription)         } 

but in datasource?.append(tdatasource?) giving me error: _?? not convertible '0'

how can append result data datasource display both results?

use extend

append appends 1 element of same type
extend appends array of same type


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -