Commit 7386ac35 authored by Eike Ziller's avatar Eike Ziller
Browse files

iossim: Fix compilation against SDKs earlier than 10.9



Looks like firstObject is not exported in SDKs ealier than 10.9,
even though the documentation claims differently. Latest Xcode
on OS X 10.7 doesn't provide the 10.9 SDK, so avoid using
firstObject and lastObject

Change-Id: Ia266c6aa2030d4799a3cec13e97ab7175adf5138
Reviewed-by: default avatarKevin Funk <kevin.funk@kdab.com>
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@theqtcompany.com>
parent 0a00bac4
......@@ -608,8 +608,8 @@ static void ChildSignal(int /*arg*/) {
NSArray* devices = [deviceSet availableDevices];
NSArray* deviceTypeAndVersion = [devTypeId componentsSeparatedByString:@","];
if(deviceTypeAndVersion.count == 2) {
NSString* typeIdentifier = [deviceTypeAndVersion.firstObject stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSString* versionString = [deviceTypeAndVersion.lastObject stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];;
NSString* typeIdentifier = [[deviceTypeAndVersion objectAtIndex:0] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSString* versionString = [[deviceTypeAndVersion objectAtIndex:1] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];;
for (SimDevice* device in devices) {
if ([device.deviceType.identifier isEqualToString:typeIdentifier] && [device.runtime.versionString isEqualToString:versionString]) {
return device;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment