iPhone Code Schnipsel: Kennung des Gerätes
Gesucht
Die Kennung (Identifier bzw. UDID) eines iPhone oder iPod Touch programmatisch ermitteln.
Lösung
UIDevice *device = [UIDevice currentDevice];
NSString *uniqueIdentifier = [device uniqueIdentifier];
UIDevice bietet außerdem Instanzmethoden zur Bestimmung von Name (name) und Modell (model) des Gerätes sowie Name (systemName) und Version (systemVersion) des Betriebssystems. Beispiel für mein iPhone:
Name: MyPhone Model: iPhone SystemName: iPhone OS SystemVersion: 2.2.1
Schlüsselwörter: iphone, programmierung, schnipsel
Schlüsselwörter
- berlin (2)
- blog (5)
- browser (2)
- cocoaheads (5)
- dropbox (1)
- git (7)
- idisk (1)
- iphone (28)
- javascript (2)
- kurztip (4)
- linktips (17)
- mac (9)
- macruby (1)
- objective-c (8)
- ortung (1)
- programmierung (22)
- rails (1)
- railsconf (7)
- ruby (6)
- ruby on rails (7)
- schnipsel (14)
- server (2)
- spiele (1)
- statistiken (3)
- stuttgart (3)
- testen (4)
- tidy (1)
- versionskontrolle (5)
- wwdc (1)
- xcode (9)
- xml (1)
Kommentare