- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
好的,我在从 iOS 6 升级到 7 时遇到问题。iOS 6 工作正常,但在 iOS7 中出现以下错误
我不确定,但我认为错误发生在这里。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Events Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell...
Event *event = [self.fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = event.name;
return cell;
}
基本上,当我调用 TableViewCell 时,它会弹出一个 Datepicker,但是当我点击“完成”按钮时,它会崩溃。有什么线索吗?
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewWrapperView indexPathForCell:]: unrecognized selector sent to instance 0xc133070'
2013-09-24 17:26:14.056 CRM4Life[36587:a0b] -[UITableViewWrapperView indexPathForCell:]: unrecognized selector sent to instance 0xc133070
2013-09-24 17:26:14.097 CRM4Life[36587:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewWrapperView indexPathForCell:]: unrecognized selector sent to instance 0xc133070'
*** First throw call stack:
(
0 CoreFoundation 0x02d425e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x019818b6 objc_exception_throw + 44
2 CoreFoundation 0x02ddf903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x02d3290b ___forwarding___ + 1019
4 CoreFoundation 0x02d324ee _CF_forwarding_prep_0 + 14
5 CRM4Life 0x0000dd0e -[CoreDataTableViewCell resignFirstResponder] + 206
6 UIKit 0x00640550 -[UIResponder becomeFirstResponder] + 347
7 UIKit 0x00543d0b -[UIView(Hierarchy) becomeFirstResponder] + 114
8 UIKit 0x00bc30e3 -[UITextField becomeFirstResponder] + 51
9 UIKit 0x00868651 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary] + 135
10 UIKit 0x0086aba2 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) oneFingerTap:] + 2640
11 UIKit 0x0085ef8c _UIGestureRecognizerSendActions + 230
12 UIKit 0x0085dc00 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 383
13 UIKit 0x0085f66d -[UIGestureRecognizer _delayedUpdateGesture] + 60
14 UIKit 0x00862bcd ___UIGestureRecognizerUpdate_block_invoke + 57
15 UIKit 0x00862b4e _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
16 UIKit 0x00859248 _UIGestureRecognizerUpdate + 199
17 UIKit 0x00525d4a -[UIWindow _sendGesturesForEvent:] + 1291
18 UIKit 0x00526c6a -[UIWindow sendEvent:] + 1030
19 UIKit 0x004faa36 -[UIApplication sendEvent:] + 242
20 UIKit 0x004e4d9f _UIApplicationHandleEventQueue + 11421
21 CoreFoundation 0x02ccb8af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
22 CoreFoundation 0x02ccb23b __CFRunLoopDoSources0 + 235
23 CoreFoundation 0x02ce830e __CFRunLoopRun + 910
24 CoreFoundation 0x02ce7b33 CFRunLoopRunSpecific + 467
25 CoreFoundation 0x02ce794b CFRunLoopRunInMode + 123
26 GraphicsServices 0x02f9c9d7 GSEventRunModal + 192
27 GraphicsServices 0x02f9c7fe GSEventRun + 104
28 UIKit 0x004e794b UIApplicationMain + 1225
29 CRM4Life 0x0000216d main + 141
30 CRM4Life 0x000020d5 start + 53
31 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
最佳答案
//for iOS 6 or earlier
UITableView* tableView = (UITableView *)cell.superview;
// for iOS 7 UITableViewWrapperView has been added as superview
if (IOS_7) {
tableView = (UITableView *)cell.superview.superview;
}
在 iOS7 中
UITableViewCellScrollView
已作为单元格的 subview 引入
UITableViewWrapperView
已被引入作为单元格的 super View 。 (只需额外 1 级)
So if you want to get the UITableView instance out of UITableViewWrapperView, you will have to use superview on UITableViewWrapperView instance.
关于datepicker - NSInvalidArgumentException',原因: '-[UITableViewWrapperView indexPathForCell:],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18994290/
我在这里撕扯我的头发。已阅读许多描述如何解决此问题的示例,但没有一个可以帮助我解决该问题。 在 UIView 上有一个链接到 IBAction 的简单按钮。 代码是这样的... 联系方式.h #imp
我在 map 中有一些注解 View ,我希望通过touchUpInside打开一个新的ViewController,但出现此错误: Terminating app due to uncaught
我想尝试一下群众的智慧……因为我现在很沮丧。提前致谢。 这是我的代码: - (void)imagePickerController:(UIImagePickerController *)ipc did
我遇到以下问题。我继承了一个应用程序,我正在尝试修改它。原始功能允许我添加带有一些文本注释的任务。我想添加一个图标以使其更具视觉吸引力。当我修改代码签名以传递图标时(实际上我只是在 NSString
[__NSArrayM relatedObjectDidChange]: unrecognized selector sent to instance error Class: NSInvalidAr
我有两个viewController,都带有一个表,应用程序可以工作,然后我在第二个viewController 中添加了导航栏,让他有机会在第一个viewController 中返回。导航栏可以工作
通常应用程序运行良好,但我在 Crashlytics 中收到问题。一周发生1-2次。适合 2k-3k 用户。应用程序适用于 iOS 7 及更高版本。报告:致命异常:NSInvalidArgumentE
此函数旨在获取 JSON 并根据作为参数发送的对象创建对象数组: + (NSArray *)Object: (id) object FromJSON:(NSData *)objectNotation
尝试将核心数据对象获取到tableview并获得Terminating app due to uncaught exception 'NSInvalidArgumentException', reas
我设计了一个应用程序,它将有一个按钮和三个标签。 当按下按钮时,将调用一个URL。 URL的JSON表示如下: [ { "_id": "50c87e8a1898044ea1458e4c",
我以编程方式实现了自动布局。 self.rightSideLine = [[UIView alloc] init]; self.rightSideLine.backgroundColor = COLO
我有一个 iOS 应用程序,可以在 Appstore 中找到。今天我测试了该应用程序,当应用程序尝试打开错误对话框时,它在我的 iPhone4 (iOS7) 上崩溃了。在 iPhone5s 上没有问题
我在其他地方使用“正常工作”的代码时遇到错误: [Error]: Caught "NSInvalidArgumentException" with reason "*** -[_NSPlacehold
我正在编写代码以向图片添加滤镜。这是代码 func applyFilter(index: Int){ print("Applying Filter....") //let contex
我正在练习创建一个主要不使用 Storyboard的 UI,当我开始调试时,我的应用程序崩溃了,并给我带来了这个错误。 我尝试从 info.plist 和目标中删除“main”,但不起作用 2019-
我有一个 tableView,我在一个单元格上创建了一个 Button。 UIButton *deleteGroupButton = [UIButton buttonWithType:UIButt
这是我的代码: @interface TabRegsViewController () @end @implementation TabRegsViewController @synthesize p
即使在这个项目之前我从未在 Objective-C 中工作过或制作过 iOS 应用程序,但我处于必须支持其他人代码的“令人敬畏”的位置,所以如果我做了一些非常明显或愚蠢的事情,请原谅. 我需要一个带有
我的代码抛出以下异常: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[_
我有一个无法理解的问题,我正在使用一个用于使用Map Open Source Map(https://github.com/route-me/route-me)的库,该示例运行完美,并且我相信不是与代
我是一名优秀的程序员,十分优秀!