今天是个好日子!问题是“如何更新 subViews 数据?” 我设法将子视图添加到 mainView 中,如下所示:
currenWeatherView.clipsToBounds = NO;
currenWeatherView.layer.cornerRadius = 10.0;
CGRect view1Hrame;
view1Hrame.origin.x = 230*i;
view1Hrame.origin.y = 0;
view1Hrame.size = self.currenWeatherView.frame.size;
weatherViewController *view1 = [[weatherViewController alloc] initWithForecast:[[Forecast alloc] initWithForecastInSelectedCity: theCity]];
[view1.view setFrame: view1Hrame];
[currenWeatherView addSubview: view1.view];
然后我想像这样更改数据
for (weatherViewController *theView in weatherViewControllerArray) {
[theView.self labelWeekTapped:2];
但是 theView 只是一个视图而不是类实例((
请帮忙。