You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per the accompanying NSLog statement, I am posting this comment...
When run on an iPad Air (hardware 'iPad4,2'), the hardwareDescription method returns an empty string. I assume that this code does not yet support iPad Air or mini with retina.
Here's code to support the new devices:
// support for iPad Air and mini retina
if ([hardware isEqualToString:@"iPad4,1"]) return @"iPad Air (WiFi)";
if ([hardware isEqualToString:@"iPad4,2"]) return @"iPad Air (GSM)";
if ([hardware isEqualToString:@"iPad4,3"]) return @"iPad Air (CDMA)";
if ([hardware isEqualToString:@"iPad4,4"]) return @"iPad Mini Retina (WiFi)"; // unconfirmed
if ([hardware isEqualToString:@"iPad4,5"]) return @"iPad Mini Retina (Cellular)"; // unconfirmed
Suggestion: instead of just returning an empty string for unknown devices, would it make sense to at least return the generic device type? In other words, since we know that the hardware is "iPad4,2" couldn't the hardwareDescription method return "iPad" in this case?
// return generic strings for unknown devices
if ([hardware hasPrefix:@"iPhone"]) return @"iPhone";
if ([hardware hasPrefix:@"iPod"]) return @"iPod";
if ([hardware hasPrefix:@"iPad"]) return @"iPad";
The text was updated successfully, but these errors were encountered:
As per the accompanying NSLog statement, I am posting this comment...
When run on an iPad Air (hardware 'iPad4,2'), the hardwareDescription method returns an empty string. I assume that this code does not yet support iPad Air or mini with retina.
Here's code to support the new devices:
// support for iPad Air and mini retina
if ([hardware isEqualToString:@"iPad4,1"]) return @"iPad Air (WiFi)";
if ([hardware isEqualToString:@"iPad4,2"]) return @"iPad Air (GSM)";
if ([hardware isEqualToString:@"iPad4,3"]) return @"iPad Air (CDMA)";
if ([hardware isEqualToString:@"iPad4,4"]) return @"iPad Mini Retina (WiFi)"; // unconfirmed
if ([hardware isEqualToString:@"iPad4,5"]) return @"iPad Mini Retina (Cellular)"; // unconfirmed
Suggestion: instead of just returning an empty string for unknown devices, would it make sense to at least return the generic device type? In other words, since we know that the hardware is "iPad4,2" couldn't the hardwareDescription method return "iPad" in this case?
// return generic strings for unknown devices
if ([hardware hasPrefix:@"iPhone"]) return @"iPhone";
if ([hardware hasPrefix:@"iPod"]) return @"iPod";
if ([hardware hasPrefix:@"iPad"]) return @"iPad";
The text was updated successfully, but these errors were encountered: