Re: What iOS device?

2014-01-31 Thread Fritz Anderson
On 31 Jan 2014, at 12:45 AM, KappA  wrote:

> I came across this the other day. Have you already looked at this?
> 
> http://stackoverflow.com/questions/448162/determine-device-iphone-ipod-touch-with-iphone-sdk

Very strange that nobody (until I did) noticed that if you want to convert from 
one unique constant NSString to another, you use an NSDictionary, not a cascade 
of

if ([a isEqualToString: @"b"]) return @"c";

And if you load a plist instead of hardcoding every damn pair, your code gets a 
lot simpler.

Sigh. This is always the point where I miss something crucial…

— F


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: What iOS device?

2014-01-30 Thread Gerriet M. Denkmann

On 31 Jan 2014, at 13:45, KappA  wrote:

> I came across this the other day. Have you already looked at this?
> 
> http://stackoverflow.com/questions/448162/determine-device-iphone-ipod-touch-with-iphone-sdk

Thanks for this link. They are using "hw.machine" instead of "hw.model" which 
gives less cryptic results (like "iPhone4,1" instead of "N94AP").

An official API would be better still. 
But this is something I can live with.

Kind regards,

Gerriet.

> 
> 
> On Fri, Jan 31, 2014 at 1:19 AM, Gerriet M. Denkmann  
> wrote:
> I want (for logging purposes only) to know the kind of iOS device being used.
> 
> UIDevice model or localizedModel returns just "iPhone", but I want something 
> like "iPhone 4s" or "iPad Air" etc.
> NSProcessInfo physicalMemory can be used to distinguish between some models, 
> but not all.
> 
> Then there is sysctlbyname("hw.model",...) but this returns cryptic stuff 
> like: "J71AP"  or "N94AP".
> Is there some official table to convert this to something more readable?
> (There is  but I would 
> like something coming from Apple).
> 
> What else can be done?
> 
> Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: What iOS device?

2014-01-30 Thread KappA
I came across this the other day. Have you already looked at this?

http://stackoverflow.com/questions/448162/determine-device-iphone-ipod-touch-with-iphone-sdk


On Fri, Jan 31, 2014 at 1:19 AM, Gerriet M. Denkmann
wrote:

> I want (for logging purposes only) to know the kind of iOS device being
> used.
>
> UIDevice model or localizedModel returns just "iPhone", but I want
> something like "iPhone 4s" or "iPad Air" etc.
> NSProcessInfo physicalMemory can be used to distinguish between some
> models, but not all.
>
> Then there is sysctlbyname("hw.model",...) but this returns cryptic stuff
> like: "J71AP"  or "N94AP".
> Is there some official table to convert this to something more readable?
> (There is  but I
> would like something coming from Apple).
>
> What else can be done?
>
> Gerriet.
>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rejekted%40gmail.com
>
> This email sent to rejek...@gmail.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

What iOS device?

2014-01-30 Thread Gerriet M. Denkmann
I want (for logging purposes only) to know the kind of iOS device being used.

UIDevice model or localizedModel returns just "iPhone", but I want something 
like "iPhone 4s" or "iPad Air" etc.
NSProcessInfo physicalMemory can be used to distinguish between some models, 
but not all.

Then there is sysctlbyname("hw.model",...) but this returns cryptic stuff like: 
"J71AP"  or "N94AP". 
Is there some official table to convert this to something more readable? 
(There is  but I would 
like something coming from Apple).

What else can be done?

Gerriet.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com