mercredi 28 février 2018

Why breakpoint breaks at else block in 'if else' condition

I am trying to figure out, why, if I put breakpoints on if and on else line, why my if else {} condition breaks on else if the condition was true in if block?

I am using realm but I do not thing, that is an issue.

//Check if Object already exists in database
if !RealmService.shared.ifPortfolioExists(name: portfolio.name){//Breakpoint on this line which is true

     //Create portfolio
     RealmService.shared.create(portfolio)
     //Assign portfolio to transaction
     transaction.portfolio = portfolio
     //Create transaction
     RealmService.shared.create(transaction)

}else{//Breakpoint on this line

     //Assign portfolio to transaction       
     transaction.portfolio = portfolio
     //Create transaction
     RealmService.shared.create(transaction)

}

Am I working out of my mind or am I just stupid? Can please someone explain me this.

Aucun commentaire:

Enregistrer un commentaire