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

who has an idea how to show something that save in parse let say a "username" and then show it in the in a UILabel

i was thinking something like that :

UILabel * showtext = [[UILabel alloc] init]; showtext.text = user.username.text; //use.username.text the method used to save the user to parse [self.view addSubview:showtext];

2 Answers

Peter Pult
Peter Pult
8,095 Points

I tested it with the following code and it worked for me.

UILabel * showtext = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 290, 30)];
showtext.text = @"Great Text";
[self.view addSubview:showtext];

Make sure your user.username.text gives you a string. It's mostly a good idea to define the place on the screen where you want your subview to appear. If you are using constraints fit your code accordingly.

both ways worked i was just looking if nobody had a better way you