I use below code for change keyboard layout from code but occur below warning from second line.
//warning
Assigning to 'TISInputSourceRef' (aka 'struct __TISInputSource *') from 'const void *' discards qualifiers
//code
CFArrayRef sourceList = TISCreateInputSourceList (NULL, false);
TISInputSourceRef wantedSource= CFArrayGetValueAtIndex(sourceList, 0);
TISSelectInputSource(wantedSource);
I think you need to cast the value returned by
CFArrayGetValueAtIndex, which is of typeconst void*: