Hi All
This is a bit of a noob question as I am new to Objective C, Cocoa and the iPhone SDK.
The outcome of this is to load a movie file. I want it to pick a movie at random from several named movie0.m4v to movie3.m4v
I generated a random number using:
Quote:
|
int r = arc4random() % 4;
|
Then I use "r" to append to the movie name like this:
Quote:
|
NSString *moviePath = [bundle pathForResource:@"movie"+r ofType:@"m4v"];
|
This doesn't work..
If I remove the reference to "r". Then rename one of my movies to "movie.m4v" it works a treat.
Can anyone shed some light on this for me.
Will be much appreciated.
Thanks.