Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tstechnik

macrumors newbie
Original poster
Dec 4, 2014
2
0
Hello everyone ,
I need help . how can i integer value from array to UILabel on side by side .

Example: i have 10 in my integer array , how can I 2 4 5 6 7 8 9 10 so . ? With line works, but not next to each other .
Code:
    NSInteger rest[32];
    int zahl = myLabel.text.intValue;
    int count = 0;
    bool go = true;
    
    NSString *string = @"";
    
    if (go == true) {
        for (int i = 0; i < 32; i++) {
            rest[i] = zahl % 2;
            zahl = zahl / 2;
            count ++;
            myLabel.numberOfLines=2;
            string = [string stringByAppendingFormat:@"%li \n", (long)rest[i]];
            if (zahl == 0) {
                while (count > 0) {
                    NSLog(@"%li", (long)rest[count - 1]);
                    count--;
                }
                
                myLabel.text = string;
                break;
            }
        }


----------

Hello everyone ,
I need help . how can i integer value from array to UILabel on side by side .

Example: i have 10 in my integer array , how can I 2 4 5 6 7 8 9 10 so . ? With line works, but not next to each other .
 
Last edited by a moderator:

grandM

macrumors 68000
Oct 14, 2013
1,508
298
I didn't test your code but if it works you probably just have to delete the \n. You could also have used stringByAppendingString by the way.
 

tstechnik

macrumors newbie
Original poster
Dec 4, 2014
2
0
Hi

Fine thank you, i dont see "\n". I have remove "\", my code is working.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.