jjzjj

NSRangeException

全部标签

ios - 在我的表格 View 中设置单元格时索引超出范围

在我的表格View中设置单元格时,我遇到了这个问题:日志:*Terminatingappduetouncaughtexception'NSRangeException',reason:'*-[__NSArrayMobjectAtIndex:]:index5beyondbounds[0..4]'***Firstthrowcallstack:(0x18696afd80x1853cc5380x1868491f00x100918a300x10091960c0x18cddf1140x18cddf32c0x18cdcca300x18cde431c0x18cb7c92c0x18ca971580x18

ios - 致命异常 : NSRangeException - index 2 beyond bounds [0 .。 1]

在我在swift项目中使用的库之一中,一行导致应用程序崩溃。我试图理解并修复它,但没有运气。我知道它是由数组索引错误引起的。谁能帮忙?崩溃报告FatalException:NSRangeException0CoreFoundation0x180a42e38__exceptionPreprocess1libobjc.A.dylib0x1800a7f80objc_exception_throw2CoreFoundation0x180922ebc-[__NSArrayMremoveObjectAtIndex:]30x10000ac70-[ChatSectionManagermessageFo

ios - 设置属性文本,NSRangeException 错误

尝试通过选择设置我的UITextView的属性文本属性。几乎可以工作。设置下面红色字体颜色的文本的操作。这有时有效,但经常会出错:Terminatingappduetouncaughtexception'NSRangeException',reason:'NSMutableRLEArrayobjectAtIndex:effectiveRange::Outofbounds'即使TextView中的字符似乎比所选范围指示的字符多得多,也会发生这种情况。-(IBAction)setText:(id)sender{NSMutableAttributedString*string=[[NSMut

ios - -[PUPhotosGridViewController assetAtIndexPath :] NSRangeException

Thread:FatalException:NSRangeException0CoreFoundation0x2ff42f03__exceptionPreprocess+1301libobjc.A.dylib0x3a6d7ce7objc_exception_throw+382CoreFoundation0x2fed6eff-[__NSOrderedSetMobjectAtIndex:]+2023PhotosUI0x369ab149-[PUPhotosGridViewControllerassetAtIndexPath:]4PhotosUI0x369b55b7-[PUPhotosGrid

ios - 自动展开 UITableView - NSRangeException

我有一个SQLite数据库绑定(bind)到我的uitableview。大约有2000行,所以我首先检索25行。滚动到列表末尾后,我希望它自动检索另外25行。这是我现在使用的方法。忽略如果我加载所有2000行会发生什么,我稍后会担心。在tableView:numberOfRowsInSection:中,我返回的行比当前加载的行多一个。然后在tableView:cellForRowAtIndexPath:中,如果加载最后一行,我会加载更多行。通常我可以翻几页,但我最终得到了一个异常(exception):***由于未捕获的异常“NSRangeException”而终止应用程序,原因:“*

ios - UIDatePicker NSRangeException 崩溃 iOS 11

我有以下代码将DatePicker添加到我的UIView之一。UIDatePicker*datePicker=[[UIDatePickeralloc]initWithFrame:CGRectMake(0,30,320,250)];[datePickersetDatePickerMode:UIDatePickerModeDate];datePicker.hidden=NO;datePicker.date=[NSDatedate];[datePickeraddTarget:selfaction:@selector(changeDateInLabel:)forControlEvents:UI

IOS:致命异常:NSRangeException

应用程序在iOS11更新之前运行良好。在iOS11推出后,一些用户遇到了以下崩溃,但我无法在模拟器iOS11中重现此问题。基于fabric.io,并非所有iOS11都经历过此问题,到目前为止我只收到来自4个用户的22份崩溃报告。在这里需要一些帮助,谢谢。FatalException:NSRangeException***-[__NSArrayMobjectAtIndex:]:index9223372036854775807beyondbounds[0..1]FatalException:NSRangeException0CoreFoundation0x185b7fd38__except

ios - 'NSRangeException',原因 : '*** -[__NSArrayI objectAtIndex:]: index 3 beyond bounds [0 .. 2]'

我尝试在UIPageView中显示三张图片,但每次滑动到第三张图片时,我都会收到此错误:'NSRangeException',原因:'***-[__NSArrayIobjectAtIndex:]:索引3超出范围[0..2]'我已经检查了关于同一问题的其他问题,但无法弄清楚我的问题出在哪里。这是输出的其余部分:***Firstthrowcallstack:(0CoreFoundation0x000000010a410c65__exceptionPreprocess+1651libobjc.A.dylib0x000000010a0a9bb7objc_exception_throw+452C

ios - 由于未捕获的异常 'NSRangeException' 而终止应用程序,原因 : 'Cannot remove an observer - ios

我正在使用swift开发ios应用程序。我正在使用xcode7.0.1。与TableViewController。我想在单击行时展开并在再次单击时折叠。我正在按照gitHub中的教程进行操作.现在我面临错误Terminatingappduetouncaughtexception'NSRangeException',reason:'Cannotremoveanobserverforthekeypath"frame"frombecauseitisnotregisteredasanobserver.'我希望以下代码行会导致问题。我的UITableViewCell类代码:funccheckHe

ios - NSAttributedString 初始化抛出 NSRangeException

我写了一个简单的扩展来解码html实体:extensionString{funchtmlDecode()->String{ifletencodedData=self.data(using:String.Encoding.unicode){letattributedString=try!NSAttributedString(data:encodedData,options:[NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType,NSCharacterEncodingDocumentAttribute:String.Encoding.