IPAD FULLNAMEFROMDEVICE IS NOT RETRIEVED WHILE IPHONE FULLNAMEFROMDEVICE IS PROPERLY RETRIEVED

Manoj Bhatt

Total Post:154

Points:1086
Posted by  Manoj Bhatt
iPhone 
 1388  View(s)
Ratings:
Rate this:
Hi Developers,

I have implemented this sample category to get the "fullNameFromDevice" inside my application. Even this example is also not giving me fullNameFromDevice for iPad. There is not any issue to read iPhone device or iPad/iPhone simulator's name using this category.Only issue comes with iPad name.What problem can be?

Suggest me the appropriate solution of this issue.
Your help is a great appreciated. 
  1. Dev Patel

    Post:26

    Points:182
    Re: iPad fullNameFromDevice is not retrieved while iPhone fullNameFromDevice is properly retrieved

    Hi Manoj,


    Your iPad's name doesn't fit naming patterns suggested by this category.

    Look at -(NSString *)fullNameFromDevice:

    if (![self deviceNameContainDeviceKind])
        return nil;
    Then at

    -(BOOL)deviceNameContainDeviceKind
    {
        return [self.name rangeOfString:@"iPhone"].location != NSNotFound
        || [self.name rangeOfString:@"iPod"].location != NSNotFound
        || [self.name rangeOfString:@"iPad"].location != NSNotFound;
    }
    You can see that if device's name does not contain "iPhone", "iPod" or "iPad", fullNameFromDevice will return nil.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!