A method of sorting adherent cells using optically detectable codes, the method comprising: providing a plurality of adherent cells attached to a substrate, each adherent cell of the plurality of adherent cells comprising an optical marker in a first optical state, the optical marker being convertible from the first optical state to a second optical state upon application of light energy, wherein the first optical state defines a first optically detectable code and the second optical state defines a second optically detectable code; selectively applying the light energy to a subset of the plurality of adherent cells while attached to the substrate, thereby selectively converting the optical markers of the subset from the first optical state to the second optical state; detaching the plurality of adherent cells from the substrate; and sorting the plurality of adherent cells based on whether the optical marker of each adherent cell is exhibiting the first optically detectable code or the second optically detectable code; wherein the optical marker comprises a chromophoric polymer particle that is a photoswitchable chromophoric polymer particle comprising a polymer matrix comprising a chromophoric polymer, and a photochromic molecule; and wherein the first optically detectable code is defined according to one or more optical coding parameter selected from emission peak wavelength, emission peak intensity, and emission lifetime; and wherein the second optically detectable code is defined according to one or more optical coding parameter selected from emission peak wavelength, emission peak intensity, and emission lifetime. providing a plurality of adherent cells attached to a substrate, each adherent cell of the plurality of adherent cells comprising an optical marker in a first optical state, the optical marker being convertible from the first optical state to a second optical state upon application of light energy, wherein the first optical state defines a first optically detectable code and the second optical state defines a second optically detectable code; selectively applying the light energy to a subset of the plurality of adherent cells while attached to the substrate, thereby selectively converting the optical markers of the subset from the first optical state to the second optical state; detaching the plurality of adherent cells from the substrate; and sorting the plurality of adherent cells based on whether the optical marker of each adherent cell is exhibiting the first optically detectable code or the second optically detectable code; wherein the optical marker comprises a chromophoric polymer particle that is a photoswitchable chromophoric polymer particle comprising a polymer matrix comprising a chromophoric polymer, and a photochromic molecule; and wherein the first optically detectable code is defined according to one or more optical coding parameter selected from emission peak wavelength, emission peak intensity, and emission lifetime; and wherein the second optically detectable code is defined according to one or more optical coding parameter selected from emission peak wavelength, emission peak intensity, and emission lifetime.