Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Beginner question on Arrays

Hi guys, this is my first post. I have just finished the crystal ball course and started making a similar app on my own to practice what I had learned.

I have an Array of quotes that I want to display in uppercase and I can't figure out how to make it happen. There was an earlier tutorial about making a basic string become uppercase in the log, but my situation seems to be different since all of the text is coming from the array.

I've looked at the documentation and tried to implement a few things but nothing is working. Any help or tips would be greatly appreciated!

Here is an example of what is outputting the text for me

-(void) newQuote { self.labeltext.text = [self.quotes randomize];

}

  • identical to crystal ball really. I tried adding in 'uppercaseString', but since it's not a string so that doesn't work. I'm a complete novice with this stuff so apologies if I'm way off.

3 Answers

I think you'd want to do something like

NSString *stringName = self.labeltext.text

Then something like

[stringName uppercaseString];

I am very new to all of this so take that with a grain of sand. If I am incorrect please correct me so I can learn as well.

if i remember correct there's a workShop in treehouse on special string and i think they covers this.

Thanks for the suggestion Eric. I thought I might be getting somewhere but it hasn't worked out for me. And now that I deleted the changes to start again my app is crashing every time I try to run it.

Maybe what you have said is correct and I just didn't implement it correctly. Hopefully someone else can help.