的左操作您好,我得到了「左值要求作爲分配的左操作數」在Xcode錯誤。爲什麼? 這裏是我的代碼(窗口1/2的UIViewController):左值需要作爲分配
- (void)loadView
{
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,320,460)];
UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0,0,640,460)];
self.window1 = [TweetViewController alloc];
self.window2 = [InfoViewController alloc];
[contentView addSubview:self.window1.view];
self.window2.view.frame.origin.x = 320; //HERE IS THE ERROR!!
[contentView addSubview:self.window2.view];
[scrollView addSubview:contentView];
scrollView.contentSize = contentView.frame.size;
scrollView.pagingEnabled = YES;
self.view = scrollView;
[contentView release];
[scrollView release];
}
感謝您的幫助。
沒有他需要初始化鳴叫和信息視圖控制器呢? – ennuikiller 2010-01-04 10:10:04
@ennuikiller確實,但那是另一個問題。我只是在回答左值問題 – epatel 2010-01-04 10:11:36