Wie ordne ich dem nsstring-Objekt einen NSString mit Variablen zu?
Ich habe folgenden Code:
long mins = 02; long secs = 35;
NSString *allTime = [[NSString alloc]init];
allTime = @"%i:%i",mins, secs ;
Aber es funktioniert nicht, denn wenn ich versuche, dieses nsstring-Objekt anzuzeigen, erhalte ich Folgendes:% i:% i Stattdessen möchte ich: 02:35 erhalten
Wie geht das ? Vielen Dank!
allTime = [NSString stringWithFormat:@"%l/%l", mins, secs];
for(Playlists *thePL in collection)
{
NSLog(@"===NEXT PLAYLIST===");
NSLog(@"Name: %@", thePL.namePL);
NSLog(@"Quantity of songs: %i", thePL.entries);
NSLog(@"Total of time: %@",thePL.allTime);
}
GESAMTZEIT: l