Jak przypisać obiektowi nsstring NSString ze zmiennymi?
Mam następujący kod:
long mins = 02; long secs = 35;
NSString *allTime = [[NSString alloc]init];
allTime = @"%i:%i",mins, secs ;
Ale to nie działa, ponieważ gdy próbuję wyświetlić ten obiekt nsstring, otrzymałem:% i:% i Zamiast tego chcę uzyskać: 02:35
Jak to zrobić ? Dziękuję Ci!
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);
}
RAZEM CZAS: l