Checking if the device is an iPhone or iPod Touch
I've done some searching but can't find this out, is there a way to check whether your app is running on an iPhone or iPod Touch? I'm putting in some graphics options for Slope Rider and I want different default configurations for iPhones to iPod Touches.
I've read that 2XL Supercross has different numbers of computer players on different devices so I'm guessing it is possible somehow.
Thanks for any help.
I've read that 2XL Supercross has different numbers of computer players on different devices so I'm guessing it is possible somehow.
Thanks for any help.
I don't have device to test this now, but I think you can use UIDevice to determine whether it is iPhone or iPod Touch.
Code:
NSLog(@"name = %@",[[UIDevice currentDevice] name]);iPlayful : games for iPhone and iPod Touch
sthaqu Wrote:I don't have device to test this now, but I think you can use UIDevice to determine whether it is iPhone or iPod Touch.
Code:
NSLog(@"name = %@",[[UIDevice currentDevice] name]);
That wont work, it just returns the name of the device which the user can set to anything.
You need to use
Code:
if ([[[UIDevice currentDevice] model] isEqualToString: @"iPhone"])kodex Wrote:You need to use
Code:
if ([[[UIDevice currentDevice] model] isEqualToString: @"iPhone"])
Awesome, thanks kodex. Is this a generally alright thing to be doing? Users will be able to ramp up the graphics settings anyway, it's just for setting the defaults.
With an eye to the future (and Apple releasing an updated iPhone soon-ish) will there be a way to test which generation a user has?
monteboyd Wrote:With an eye to the future (and Apple releasing an updated iPhone soon-ish) will there be a way to test which generation a user has?
If I recall correctly I have used it in the past to detect which model of touch the user has (for speaker access and such), so I would imagine you could do something with the iPhones, play around with it on different devices.
I wouldn't worry to much about graphic settings though, the iPhone and Touch run at very similar speeds, tweaking the settings may not be worth the effort.
I'll play around with it on different devices, thanks.
I am actually adding the graphics options after seeing it on a friend's iPhone (I only have a touch myself) and there are significant framerate differences. I'll be testing soon to see if the optimisations I've added help on iPhones, they certainly bump up the framereate on my Touch.
I am actually adding the graphics options after seeing it on a friend's iPhone (I only have a touch myself) and there are significant framerate differences. I'll be testing soon to see if the optimisations I've added help on iPhones, they certainly bump up the framereate on my Touch.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Line Smooth Problem on iPhone Device | abelix | 1 | 3,487 |
Sep 22, 2010 06:28 AM Last Post: Skorche |
|
| Checking for architecture? | Bersaelor | 2 | 2,332 |
Sep 20, 2010 11:56 AM Last Post: Rasterman |
|
| How much can I stuff in to video ram? (on iPhone/iPod touch) | Jamie W | 9 | 7,956 |
Aug 6, 2010 05:23 AM Last Post: mariocaprino |
|
| Pause/Resume on IPod touch | tonysameh | 0 | 2,017 |
Jul 26, 2010 06:34 AM Last Post: tonysameh |
|
| iPod Touch not multitasking not working??? | Toontingy | 1 | 3,493 |
Jun 24, 2010 04:13 PM Last Post: sealfin |
|

