iOS-8 - Holen Sie sich das aktuelle Datum als DD/MM/YYYY

Kann jemand mir einige code, wie bekomme ich das Datum?

NSDateComponents *components = [[NSCalendarcurrentCalendar] component:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYearfromDate:[NSDatedate]]; 

NSString *day = [components day]; 
NSString *week = [components month]; 
NSString *year = [components year]; 

NSString *date = [NSString stringWithFormat:@"%@.%@.%@",day,week,year];

^^ mein code funktioniert nicht :S

Und gibt es eine Möglichkeit, ich kann das Datum von morgen, in 1 Woche und so weiter...

Dank 🙂

Google "NSDateFormatter".
Definiere "funktioniert nicht".
Wie ist diese Frage off-topic? Es ist nicht zu Fragen, wer "empfehlen, oder finden Sie ein Buch, tool, software library, tutorial oder andere off-site-resource".

InformationsquelleAutor Tim | 2015-01-06

Schreibe einen Kommentar