开发者

how to make it so when a view loads, it does something?

I am making a quiz app, and I wanted it to have a saying at the end of the quiz. This saying is supposed to change based on an NSInteger (myScore). How would I code thi开发者_JS百科s? Any help would be helpful to me. Thanks!


You are going to create a UILabel based on an NSInteger:


NSInteger yourInteger;
UILabel *aLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 100);
[aLabel setText:@"Score %d", yourInteger];
[aLabel setBackgroundcolor:[UIColor clearColor]];
[aLabel setOpaque:NO];
[[self view] addSubview:aLabel];
actually %d is replaced with your integer

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜