我是 Objective-c 的新手,所以我有点难过,我在我的应用程序的另一部分有它,并且工作完美,但是当我在我的应用程序的不同视图上使用它时,它会使应用程序崩溃,我很确定我以相同的方式设置它。
我让 Xcode 在搞砸的代码和这段代码的第一行设置断点
NSArray *timesArray = [self.tableDataArray objectAtIndex:2];
NSDictionary *dictionary = [timesArray objectAtIndex:indexPath.row];
cell.timeLabel.text = [dictionary objectForKey:@"time"];
cell.destinationLabel.text = [dictionary objectForKey:@"destination"];
NSArray *timesArray 是停止的地方,但没有给出其他错误或任何东西,所以我有点不知道要改变什么。
编辑编号 1:为清楚起见,删除了旧编辑。
编辑编号 2
好的,所以我再次慢慢检查,结果是它对数据进行了 3 次完整解析,并输出了我拥有的所有内容。
2012-06-21 13:37:09.148 NextBus[5990:1a603] Array: (
{
routeName = "Oxford West";
routeNumber = 17;
stopDirection = Westbound;
stopName = "Griffith At Commissioners Sb";
stopNumber = 811;
},
"Next 3 Vehicles Arrive At:",
(
{
destination = "To Byron Baseline / Griffith";
time = "1:58 P.M.";
},
{
destination = "To Byron Baseline / Griffith";
time = "2:15 P.M.";
},
{
destination = "To Byron Baseline / Griffith";
time = "2:35 P.M.";
}
),
"Prediction Last Updated 1:37:06 Pm 6/21/2012"
)
2012-06-21 13:37:09.148 NextBus[5990:1a603] Array: (
{
routeName = "Oxford West";
routeNumber = 17;
stopDirection = Westbound;
stopName = "Griffith At Commissioners Sb";
stopNumber = 811;
},
"Next 3 Vehicles Arrive At:",
(
{
destination = "To Byron Baseline / Griffith";
time = "1:58 P.M.";
},
{
destination = "To Byron Baseline / Griffith";
time = "2:15 P.M.";
},
{
destination = "To Byron Baseline / Griffith";
time = "2:35 P.M.";
}
),
"Prediction Last Updated 1:37:06 Pm 6/21/2012"
)
2012-06-21 13:37:09.149 NextBus[5990:1a603] Array: (
{
routeName = "Oxford West";
routeNumber = 17;
stopDirection = Westbound;
stopName = "Griffith At Commissioners Sb";
stopNumber = 811;
},
"Next 3 Vehicles Arrive At:",
(
{
destination = "To Byron Baseline / Griffith";
time = "1:58 P.M.";
},
{
destination = "To Byron Baseline / Griffith";
time = "2:15 P.M.";
},
{
destination = "To Byron Baseline / Griffith";
time = "2:35 P.M.";
}
),
"Prediction Last Updated 1:37:06 Pm 6/21/2012"
)
当我拉动刷新它时
2012-06-21 13:37:45.590 NextBus[5990:1a603] Array: (
{
routeName = "Oxford West";
routeNumber = 17;
stopDirection = Westbound;
stopName = "Griffith At Commissioners Sb";
stopNumber = 811;
}
)
然后由于某种原因崩溃,它停止解析。
它是 EGO 拉动刷新套件。