对不起,如果它被问到某处,但作为初学者,我需要一个非常具体的答案为我的问题。错在哪里,更正和建议。我试图分开alloc和initWithRed ...消息,但它似乎不工作
我写那些正在申请didFinishLaunchingWithOption:
UIColor *myBackgroundColor = [[UIColor alloc]initWithRed:.87 green:.77 blue:.56 alpha:.99];
[window setBackgroundColor:myBackgroundColor];
它的工作,并更改背景颜色,然后我尝试这两个信息中分离出来。
UIColor *myBackgroundColor = [UIColor alloc];
[myBackgroundColor initWithRed:.87 green:.77 blue:.56 alpha:.99]
[window setBackgroundColor:myBackgroundColor];
我该如何编码才能使其正确运行?我将需要理由和更正。非常感谢。
更多的问题。如果我需要写“myBackgroundColor = [myBackgroundColor initWithRed:.87 green:.77 blue:.56 alpha:.99]”为什么会“[myUIView initWithFrame:myCGRect];”工作好吗? – 2011-06-09 15:07:13
如果您还有其他问题,应该将其作为新问题而不是评论。 – 2011-06-09 15:19:32