我正在为我的计算机科学课做天气处理器任务,而且我对一段代码遇到了一些麻烦。我不确定如何处理这个问题,所以任何帮助都会很棒。这是我的代码:
self.dismissViewControllerAnimated(true, completion: nil)
我遇到麻烦的部分是data.getHIGHS / LOWS / etc,它告诉我对于Object类型未定义import java.util.*;
import java.util.GregorianCalendar;
public class Info {
Object data;
String weatherRecord[][][] = new String[0][0][0];
int index = 0;
int HIGHS, LOWS, WIND, GUST, PRECIP;
public void weatherData () {
data = data;
}
final String[] locationNames = {"Eagle, NE", "New York, NY", "Houston, TX", "Los Angeles, CA"};
final int[] monthLength = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
{
for (int i = 0; i < weatherRecord.length; i++) {
GregorianCalendar dateInfo = new GregorianCalendar(2008, 0, 1);
System.out.println((dateInfo.get(Calendar.MONTH) + 1)+ "/" +
dateInfo.get(Calendar.DAY_OF_MONTH)+ "/" +
dateInfo.get(Calendar.YEAR));
for (int j = 0; j < weatherRecord[i].length; j++) {
for (int k = 0; k < monthLength[j]; k++) {
weatherRecord[i][j][k] = new weatherData();
weatherRecord[i][j][k].setLocation(locationNames[i]);
weatherRecord[i][j][k].setDate((GregorianCalendar) dateInfo.clone());
weatherRecord[i][j][k].setHighTemp(data.getHIGHS(index));
weatherRecord[i][j][k].setLowTemp(data.getLOWS(index));
weatherRecord[i][j][k].setWind(data.getWIND(index));
weatherRecord[i][j][k].setGust(data.getGUST(index));
weatherRecord[i][j][k].setPrecip(data.getPRECIP(index));
index++;
dateInfo.add(Calendar.DAY_OF_MONTH, 1);
}
System.out.println((dateInfo.get(Calendar.MONTH)+1) + "/" +
dateInfo.get(Calendar.DAY_OF_MONTH) + "/" +
dateInfo.get(Calendar.YEAR));
}
}
}
private int setLocation(String string) {
// TODO Auto-generated method stub
return 0;
}
}
方法。我哪里错了?我有另一个类,它具有此代码中方法的getter。