How to know it is iphone 3G or iphone 3GS?

Any API? I tried UIDevice, but I can only get the OS version.
How to know it is 3G or 3GS?

or
#import "UIDevicemachine.h"
#include <sys/types.h>
#include <sys/sysctl.h>
@implementation UIDevice(machine)
- (NSString *)machine
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *name = malloc(size);
sysctlbyname("hw.machine", name, &size, NULL, 0);
NSString *machine = [NSString stringWithCString:name];
free(name);
return machine;
@end
Line: -----
#import "UIDevice+machine.h"
if ( [[UIDevice currentDevice] machine] == "i386" )
//this is simulator
do some code
else
if ( [[UIDevice currentDevice] machine] == " iPhone1,1" )
//this is iPhone 2G
do some code
else
if ( [[UIDevice currentDevice] machine] == "iPhone1,2" )
//this is iPhone 3G
do some code
else
if ( [[UIDevice currentDevice] machine] == "iPhone2,1" )
//this is iPhone 3GS
do some code
else if ( [[UIDevice currentDevice] machine] == "iPod1,1" )
//this is iPod Touch 1 gen
do some code
else if ( [[UIDevice currentDevice] machine] == "iPod2,1" )
//this is iPod Touch 2 gen
do some code
else if ( [[UIDevice currentDevice] machine] == "iPod3,1" )
//this is iPod Touch 3 gen
do some code

Similar Messages

  • How to know by looking a box that iphone 6 is facetime enabled or not? while purchasing.

    i want to purchase a new iphone 6. but i want to know that iphone is facetime enable or not. is there anything mentioned on the box.

    Hi, mustufa5185.
    Thank you for visiting Apple Support Communities.  
    Here are the system and hardware requirments for FaceTime for iOS.  Please note that FaceTime is not available in all regions.  
    Which Apple products support FaceTime video and FaceTime audio?
    To use FaceTime, you need one of the following Apple products:
    iPhone 4 or later
    iPad 2 or later
    iPad mini
    iPod touch (4th generation) or later
    FaceTime audio calling isn't available with iPod touch (4th generation).
    *FaceTime over cellular data isn't available on iPhone 4 or iPad 2.
    iOS: Using FaceTime
    http://support.apple.com/en-us/HT4319
    Cheers, 
    Jason H.  

  • I upload iPhone pics to Shutterfly, which gives me a "low resolution" warning and blurry prints. Does anyone know how to enhance resolution/printing quality of iPhone pictures? iPhone 5

    i upload iPhone pics to Shutterfly, which gives me a "low resolution" warning and blurry prints. Does anyone know how to enhance resolution/printing quality of iPhone pictures?
    iPhone 5

    How does iPhoto play a part in this?  You're in the iPhoto forum.  Shouldn't you be asking your question in the iPhone forum?  I'll ask the powers to be to move you question to the iPhone forum.
    OT

  • How do you transfer the content from an iPhone to a PC? I have to use a PC for a while and don't know how to put my stuff on to there from my phone

    How do you transfer the content from an iPhone to a PC? I have to use a PC for a while and don't know how to put my stuff on to there from my phone

    If you're talking about music and movies an i-device was not designed for unique storage of media. It is not a backup device and media transfer was planned with you maintaining a master copy of your media on a computer which is itself properly backed up against loss. Syncing music and movies is one way, computer to device, updating the device content to the content on the computer, not updating or restoring content on a computer. The exception is iTunes Store purchases which can be transferred from a device to a computer.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer - http://support.apple.com/kb/HT1848 - only purchases from iTunes Store
    For transferring other items from an i-device to a computer you will have to use third party commercial software.  See this document by turingtest2: Recovering your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991

  • On a windows 7, ifinally got the Iphone4 setup so i can copy my pictures off of the phone. know itunes will not detect the iphone to get it synced. how do i get it back to be seen by Itunes?

    On a windows 7, i finally got the Iphone4 setup so i can copy my pictures off of the phone. Know itunes will not detect the iphone to get it synced. how do i get it back to be seen by Itunes?

    See earlier post by tt2
    https://discussions.apple.com/message/7217190#7217190

  • How do you change the drive that my Iphone backs-up to on my computer?  My first attempt to back-up and i received a pop-up stating that I do not have sufficient memory/space, knowing that I have over 120GB of free space...any ideas? thanks

    How do you change the drive that my Iphone backs-up to on my computer?  My first attempt to back-up and i received a pop-up stating that I do not have sufficient memory/space, knowing that I have over 120GB of free space...any ideas? thanks

    dave0915,
    iTunes stores your iPhone backups in the Library folder in your Home folder.
    iTunes places the backup files in these places:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    Create and delete iPhone, iPad, and iPod touch backups in iTunes
    http://support.apple.com/en-us/HT4946
    Regards,
    Allen

  • How apple support my iphone who ever my serial is replaced and  how i know my iphone is refurbished  ??

    Hi everyone! I have iphone 4s, which was my friends bought it from canada appstore about 1 month before and has serial number DQ*******TDD and IMEI ****. When i try to check warranty on the page https://selfsolve.apple.com/wcResults.do i see
    We're sorry, but this is a serial number for a product that has been replaced. Please check your information and re-enter your serial number. If your information is correct, you may need to contact us.
    And if i try to enter IMEI here i see
    Our records indicate that this product has been replaced. Please provide the serial number for your replacement product to find the support and warranty coverage information. For more information, please contact us.
    Does it means, that I was bought a non exist iPhone? Or it was refurbished? I need an official answer to take them to seller because I was bought iPhone as a new.
    How I know my iphone is  refurbished?
    Thank you.
    answers that i folow up and find are :
    - Did you purchase the device from Apple or an authorized reseller? If not, then you were scammed.
    - It means you bought a gray market phone that was replaced, reported lost, or reported stolen, then re-sold illegally. It has no warranty and Apple will not service it with an out of warranty replacement.
    - If your phone was replaced, it was most likely refurbished.
    - You cannot tell the difference between a refurbished phone and a new one.
    - check your serial number if its starts with 5K then its refurbished model
    Not true. All it does is identify it as 'service stock'. It may be refurbised, or it may be new. There is no way for you, or even someone at an Apple Store, to tell the difference.
    6 - You bought a phone that was stolen, lost, or taken in for repair and then re-sold illegally. get your money back if you can.
                 If there is ever a hardware problem that requires service, you will most likely not be able to get it serviced or replaced by Apple.
    7- During the refurbishment process the devices are assigned a new serial number.
    8- This means that your iPhone was replaced by Apple and you entered the serial number for your old iPhone which was replaced.
    9- That means that particular phone has been replaced under warranty. Where did you get the phone from? If it was used, the previous owner may have had it replaced and not returned it to Apple as they were supposed to and sold it.
    10-  Interpreting what you postd, it would seem you had the device replaced at some earlier stage.  Apple doesn't repair but instead replaces the whole unit with a refurbished unit which has its own serial number. Whatever the case, you will have to see Apple about the matter.
    11-  white box (new) or a brown box (refurb)
    now my questions :
    how i know my iphone is refurbished and how apple support my iphone who ever my serial is replaced ??

    How can I know my device is refurbished or new one??Can I check my device is refurbished or new with serial number?

  • I purchase iphone from saudi arabia (mobily telecom), can i use this mobile in pakistan and other custires. and how i know this phone is carrier unlocked..

    i purchase iphone from saudi arabia (mobily telecom), can i use this mobile in pakistan and other custires. and how i know this phone is carrier unlocked..

    It will be locked to mobily telecom, and according to Apple's list of supported carriers and their features (http://support.apple.com/kb/HT1937) they do not offer unlocking.  Since only the carrier it is locked to can unlock it, you have bought a useless phone.

  • How to know if my iphone 4s is open line and can use it anywhere or in any country?,

    how to know if my iphone 4s is open line and can use it anywhere or in any country?,like i bougth it in united arab emirates and if im in philippines i can still use it there?.

    If you did not purchase it from an authorized distributor, then there is no way to tell short of trying a different SIM. Even then, it may have been hacked to unlock it.
    That's a risk you take when you buy from the gray market.

  • HI, i'm having this error message [There was a problem downloading the software for the iphone "banster's iphone". An unknown error occurred (-23)] when im doing the upgrading to IOS 5. anybody know how to slove it? Thanks

    HI, i'm having this error message [There was a problem downloading the software for the iphone "banster's iphone". An unknown error occurred (-23)] when im doing the upgrading to IOS 5. anybody know how to slove it? Thanks

    Yep, me to exactly the same problem,  the error message keeps telling me to check my internet connection  or try later.  Nothing wrong with my internet connection.  Is it an apple server problem?

  • HT4061 My iPhone 4 has been recently stolen :( and I am wondering how can I be able to blocked my iPhone 4 so the one steal it cannot use my phone pls let me know what to do thanks.

    My iPhone 4 has been recently stolen :( and I am wondering how can I be able to blocked my iPhone 4 so the one steal it cannot use my phone pls let me know what to do thanks.

    Apple does not get involved with lost or stolen items.  A carrier may offer IMEI blocking (non in the USA currently do, but elsewhere some do).  Your carrier would already know your IMEI number anyway, so just contact them and ask them about it.
    It is VERY good that you had a passcode lock on the device.  That means your personal information will be safe.  And yes, after 10 failed attempts (each with increasing time out between allowing another attempt) the device will permanently lock them out until they restore the device in iTunes.  Anyone can go ahead and restore your iPhone as new in iTunes, but that also wipes everything off it and restores it to new condition - which does mean they can go off and use it as theirs, but at least all your data is gone.
    Did you file a police report it was stolen?  Also your carrier should be told (and ask them about IMEI blocking).  Sorry it is gone, but you did the best thing possible to protect yourself and your information when you set up that passcode lock.

  • How to know my iphone 5 lock or unlock?

    how to know my iphone 5 lock or unlock?

    The store or person from whom you bought the iPhone should be able to tell you. If not, you can either just try a different carrier's SIM, or perhaps if you call Apple Support they may be able to tell you.
    Regards.

  • How to know my IPhone Country ?

    how to know my IPhone Country ? i have a iphone 4 with model "MC603X" and carrier "12.0" ... it is factory unlocked iphone using in INDIA ... if i restore it , will it again be locked ?

    abhishekbehal wrote:
    actually i m facing a problem ..... this iphone is jailbreaked ..... but incidently a app in cydia called "big boss" got deleted by me ..... now my cydia icon is invisible ..... how to get it back without restoring ??
    Sorry. We can't help you. Discussing jailbroken phones is forbidden by the terms of service.
    You're on your own.

  • I want to know how can I make my playlist in my iPhone be from oldest to newest?

    I want to know how can I make my playlist in my iPhone be from oldest to newest?

    You cannot do that from your phone. You can do that from your computer.

  • Hi how i know my iphone production

    Hi how i know my iphone production

    You have the standard apple care for one year after purchase, details here : http://www.apple.com/support/products/iphone.html

  • How i know my iphone is orignal

    how i know my iphone is orignal

    Type in the serial number below (Settings > General > About > Serial number)
    https://selfsolve.apple.com/agreementWarrantyDynamic.do

Maybe you are looking for

  • The method 'commit' cant be called when a global transaction is active.

    Hello, I've installed the SOAdemo a couple of times on local machines, and it works fine. Now I've deployed the SOADemo on a separate server and a strange error occurs in BPEL when testing the SOADemo. The SOAOrderBooking BPEL process runs into an er

  • No sound effects or music in iMovie 09

    iMovie 09     8.0.6 iTunes 10   10.4.1 OS X    10.6.8 Ran software update this past weekend. iMovie does not find sound effects or iTunes music since I ran the software update. Is this an iTunes issue or iMovie issue? and any guidance on fixing the i

  • Java Web Start and JVM

    Hi, I�m writing a java app that calls JNLP. Once it�s loaded, by pushing another button it calls another JNLP. This makes WEB START load in another JVM and therefore it ignores any references and values loaded in the first instance of the JNLP (becau

  • Multiple Display Adapters - Why??

    Hi guys, Got me a new W520.  See something odd I don't understand...  In Device Manager, I have two Display Adapters: Intel HD Graphics Family NVIDIA Quadro 2000M I am by no means a hardcore graphics user and I am not a gamer, but I added the 2000M w

  • SQL being generated improperly - JDBC bc - poll operation

    I have a bpel process that is kicked off by a JDBC binding component's "poll" operation. I have the PollingPostProcessing value set to MarkColumn. I've set the MarkColumnName and MarkColumnValue parameters (see below). The column I'm marking is defin