0

I have an array stored in Parse and I wanted to count the objects in the array and then display that number in a label. I have been able to count the objects but for some reason can not figure out how to turn it into a string. Here is my code:

    cell.CheckinLabel.text = (@"count = %d", [[imageObject objectForKey:@"Checkin"] count]);
    NSLog(@"count = %d", [[imageObject objectForKey:@"Checkin"] count]);

Any help would be appreciated.

1

1 Answer 1

1

Try this:

NSString *string = [NSString stringWithFormat:@"%d", [[imageObject objectForKey:@"Checkin"] count]];
yourlabel.text = string;

Or,

yourlabel.text = [NSString stringWithFormat:@"%d", [[imageObject objectForKey:@"Checkin"] count]];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.