// Check for presence of GKLocalPlayer API.
Class gcClass = (NSClassFromString(@"GKLocalPlayer");
// The device must be running running iOS 4.1 or later.
NSString *reqSysVer = @"4.1";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
BOOL osVersionSupported = ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending);
return (gcClass && osVersionSupported);
I feel like I have to combine these two approaches but can't figure out how. If I try to compile for version 3.2, xcode complains that it doesn't know GKLocalPlayer. Which, of course, makes sense. How can I prevent it from trying to run the code containing GKLocalPlayer etc. when compiling for older versions?
Thanks a lot for any hints!
Post edited by Robert Paulson on
<i>We are Gods middle children, according to Tyler Durden, with no special place in history and no special attention.</i><br />
Consider saying <i>thanks</i> by buying <a href="http://www.qego.com/thecolor.html" target="_blank">my app</a>. :]