This is the code I tried using...
in my header:
in my awakeFromNib:
and then to randomly display one of the words...
NSLog just prints (null) though and the UITextField is left blank.
Also...
I anticipate writing out every single word that it could display will be very time consuming. The iPhone already has a built in dictionary for spell checking... is there some way I can randomly choose a word from that?
Another thing... I don't think random will be very... random. It seems like each time someone launches the application it would run through the same list of words. Is there some way I can use the current time as a seed for the random number...?
in my header:
Code:
NSMutableArray *words;
in my awakeFromNib:
Code:
[words insertObject: @"Apple" atIndex: 1];
[words insertObject: @"Ball" atIndex: 2];
[words insertObject: @"Car" atIndex: 3];
[words insertObject: @"Dog" atIndex: 4];
[words insertObject: @"Fork" atIndex: 5];
and then to randomly display one of the words...
Code:
NSLog (@"%@", [words objectAtIndex: random() % 5]);
theWord.text = (@"%@", [words objectAtIndex: random() % 5]);
NSLog just prints (null) though and the UITextField is left blank.
Also...
I anticipate writing out every single word that it could display will be very time consuming. The iPhone already has a built in dictionary for spell checking... is there some way I can randomly choose a word from that?
Another thing... I don't think random will be very... random. It seems like each time someone launches the application it would run through the same list of words. Is there some way I can use the current time as a seed for the random number...?