On page 106 at the bottom is a section on making the default voice get selected and making the scrollview of the table scroll to it if necessary, but it doesn’t work for me. I’m using Xcode 4.1 on a macbook pro with Lion. I’ve googled but can’t find anything about this not working. Any ideas? My awakeFromNib code is here:
NSString *defaultVoice = [NSSpeechSynthesizer defaultVoice];
NSUInteger defaultRow = [voiceList indexOfObject:defaultVoice];
[tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:defaultRow]
Note that I have changed the line:
as the former was giving a compiler warning.
I’m guessing that somehow the table View is not connected at the point this code is called as if I paste this code into the tableViewSelectionDidChange method then after selecting another voice, the default voice is selected and correctly scrolled to. I do have the tableView connected to AppController in the NIB.