SQlite Swift unexpected result group -
i using swift sqlite. want retrieve 'flights' in groups switch 'departuredate'
if let flightquery = self.flightquery, let database = self.db { let flightgroupbydeparturedate = flightquery.group(self.departuredate) { let flightfromdb = try database.prepare(flightgroupbydeparturedate) let flightgroups = array(flightfromdb) applog.i("flightgroups count \(flightgroups.count)") // print 2 : // have 2 groups of flight // each group got 2 flights // simulate result static values flighgroup in flightgroups { applog.i("flightgroups count \(array(arrayliteral: flighgroup).count)") // print 1 : wrong ! } }catch{ applog.e("fail findflightbydeparturedate" ) } }
when print flightgroups, found 2 flights instead of 2 arrays of flight
Comments
Post a Comment