The admissibility of disputed (for whatever reason) evidence is argued by counsel and ruled upon by the trial judge pretrial-- most often in evidentiary hearings, or special hearings about the scientific validity of particular evidence.
Staley ruled against the defense about the admissibility of the sexting (and other "bad character " evidence, on the basis it was more probative (relevant to the case) than prejudicial (speaks for itself).
The defense objected to her rulings during those pretrial hearings, but must continue to do so at trial in order for an appeals court to be able to consider whether or not Staley interpreted all related law in making her rulings, and whether or not she "abused" her judicial discretion in making her rukings.