- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图了解崩溃背后的原因。
什么是__NSSingleObjectArrayI
?我找不到这方面的任何信息。
crashlytics发送的crashlog是:
Fatal Exception: NSRangeException
0 CoreFoundation 0x1836fa1c0 __exceptionPreprocess
1 libobjc.A.dylib 0x18213455c objc_exception_throw
2 CoreFoundation 0x1836eb428 +[__NSSingleObjectArrayI automaticallyNotifiesObserversForKey:]
3 boostApp 0x100070098 -[LocationPromptVc tableView:didSelectRowAtIndexPath:] (LocationPromptVc.m:269)
4 UIKit 0x189683078 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:]
5 UIKit 0x189733b34 -[UITableView _userSelectRowAtPendingSelectionIndexPath:]
6 UIKit 0x1897e6d5c _runAfterCACommitDeferredBlocks
7 UIKit 0x1897d8b10 _cleanUpAfterCAFlushAndRunDeferredBlocks
8 UIKit 0x189547854 _afterCACommitHandler
9 CoreFoundation 0x1836a77dc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
10 CoreFoundation 0x1836a540c __CFRunLoopDoObservers
11 CoreFoundation 0x1836a589c __CFRunLoopRun
12 CoreFoundation 0x1835d4048 CFRunLoopRunSpecific
13 GraphicsServices 0x18505a198 GSEventRunModal
14 UIKit 0x1895c02fc -[UIApplication _run]
15 UIKit 0x1895bb034 UIApplicationMain
16 boostApp 0x1000bbc24 main (main.m:14)
17 libdispatch.dylib 0x1825b85b8 (Missing)
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//NSArray //NSArray both are strong,nonatomic
self.selectedLocation = self.filteredLocations[indexPath.row];
[self.tableView reloadData];
[self.searchField resignFirstResponder];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.filteredLocations.count;
}
最佳答案
试试这个代码.. 可能这个代码会有所帮助。在我的应用程序中,collectionView 也遇到了同样的崩溃,而且非常罕见。它纯粹是 indexOutOfBounds 问题。我不知道我的 collectionView 怎么会显示比数据源计数更多的项目。但是条件检查对我有帮助,现在我的应用程序没有崩溃
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//NSArray //NSArray both are strong,nonatomic
if (self.filteredLocations.count > indexPath.row && indexPath.row >= 0) {
self.selectedLocation = self.filteredLocations[indexPath.row];
[self.tableView reloadData];
[self.searchField resignFirstResponder];
}
}
关于ios - ** -[__NSSingleObjectArrayI objectAtIndex :]: index 18446744073709551615 beyond bounds [0 .。 0],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40663384/
救命!我已经为这个问题苦恼了 1 个小时了。 我正在我的 .h 文件中创建一个数组 @interface LeftMenuViewController : UIViewController
我想使用 NSMutableArray 中的 ValueForKey 替换 objectAtIndex。我已经尝试了下面的代码,但是没有用,它崩溃了, [[students valueForKey:@
我有一个包含 10 个对象的 Array。我将第一个对象放入带有 String 的 Label 中。 然后我想要一个将 objectAtIndex 增加 1 的方法。 这是我的代码: //.m @in
我有 NSMutableArray “Tag”,其对象位于索引 0 上:“data”、“data1”、“data2”,索引 1:“data3”,索引 2:“data2” ...我选择的标签是“data
嗨,我有一个数组数组,我在添加某个索引后删除了一个对象。不知何故,我认为这表现得很奇怪,或者我可能忽略了一些事情。这是代码。我用 nslogs 对其进行跟踪。 for (int i = 0;
在我的 UIScrollView 中,我的数组中有 30 张图像。我尝试在数组中获取 objectAtIndex。我希望能够在 UIScrollView 停止滚动时在特定图像中显示动画。所以我在下面尝
如何在我的方法中获取 objectAtIndex。 例如,如果我使用 didSelectRowAtIndexPath:(NSIndexPath *)indexPath 我可以得到它 NSLog(@"
我正在尝试掌握 Objective C 和 Cocoa,所以我可能在这里使用了错误的术语。 我为一副纸牌创建了一个 Objective C 类,由我的主 AppDelegate.h 和 AppDele
我在使用 NSFetchedResultsController objectAtIndex 时出现内存泄漏:栈帧如下: 0 CoreFoundation __CFDataAllocate
我正在开发iOS应用程序。值存储在Array上,但是当我运行应用程序时,它崩溃,数组索引超出范围。请先帮助并谢谢。 代码: daysOfWeek = [NSArray arrayWithObjects
我有一个我想要一个值的 NSArray。 _membersArray = [_detailItem valueForKey:@"members"]; 当我使用此代码时: NSLog(@"%lu", (
我有一个 UITableView,它由从 XML 提要解析的数据数组填充。我正在努力寻找此错误的原因,并想知道是否有人可以帮助我。该错误不会经常发生。它仅在数组数量很大时发生,例如 10-15 个对象
我收到上述错误,但不知道为什么,因为我在另一个示例中实现了相同的代码。 “服务”是我的 NSMutableArray,“服务名称”是带有标签 2 的 TableView 上的标签。在 viewdidl
初学者 iOS 开发问题在这里。 我有以下格式的 plist: 我在我的应用程序中使用以下方法将这个 plist 转换为一个数组: NSMutableArray *array2 = [[NSMutab
我正在构建一个简单的 Swift CoreData TableView 应用程序。我已成功将数据保存到数据库并在 TableView 中重新加载数据。接下来我要做的是编辑这些数据。通过点击表格单元格/
所以我在这里有函数 collectionView: cellForItemAtIndexPath: func collectionView(collectionView: UICollectionVi
NSInteger *count = [monLessonArrayA count]; 对于 (i = 0; i < count; i++) { arrayVar = [monLessonArrayA
2012-06-15 17:53:25.532 BadgerNew[3090:707] *** Terminating app due to uncaught exception 'NSRangeEx
这个问题在这里已经有了答案: 关闭 9 年前。 Possible Duplicate: Is there some literal dictionary or array syntax in Obj
我有一个 NSArray,其中包含索引 0 - 9 的 10 个对象。数组中的每个条目都是一个引号。 当我的用户选择“随机引用”选项时,我希望能够从数组中选择一个随机条目并显示该条目中包含的文本。 有
我是一名优秀的程序员,十分优秀!