Ios iPad应用程序意外崩溃
我有一个用于富文本编辑的iPad应用程序 它包含一个Ios iPad应用程序意外崩溃,ios,objective-c,ipad,uitableview,Ios,Objective C,Ipad,Uitableview,我有一个用于富文本编辑的iPad应用程序 它包含一个UITableView。我已经创建了EditorView,它继承了UITableViewCell 在EditorView中,我添加了UITextView或ImageView或TableView 应用程序有时会崩溃,并显示以下消息: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ImageView layout]: un
UITableView
。我已经创建了EditorView
,它继承了UITableViewCell
在EditorView
中,我添加了UITextView
或ImageView
或TableView
应用程序有时会崩溃,并显示以下消息:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ImageView layout]: unrecognised selector sent to instance 0x1886f650'
First throw call stack:
ARRAY : (
0 CoreFoundation 0x30374e9b <redacted> + 154
1 libobjc.A.dylib 0x3ab296c7 objc_exception_throw + 38
2 CoreFoundation 0x303787b7 <redacted> + 202
3 CoreFoundation 0x303770af <redacted> + 706
4 CoreFoundation 0x302c5dc8 _CF_forwarding_prep_0 + 24
5 ZohoWriter 0x000a916f -[EditorView layoutSubviews] + 1642
6 UIKit 0x32af9353 <redacted> + 346
7 QuartzCore 0x3277f943 <redacted> + 142
8 QuartzCore 0x3277b167 <redacted> + 350
9 QuartzCore 0x3277aff9 <redacted> + 16
10 QuartzCore 0x3277aa0d <redacted> + 228
11 QuartzCore 0x3277a81f <redacted> + 314
12 QuartzCore 0x3277454d <redacted> + 56
13 CoreFoundation 0x3033ff69 <redacted> + 20
14 CoreFoundation 0x3033d8f7 <redacted> + 286
15 CoreFoundation 0x3033dc43 <redacted> + 738
16 CoreFoundation 0x302a8471 CFRunLoopRunSpecific + 524
17 CoreFoundation 0x302a8253 CFRunLoopRunInMode + 106
18 GraphicsServices 0x34fbc2eb GSEventRunModal + 138
19 UIKit 0x32b5d845 UIApplicationMain + 1136
20 ZohoWriter 0x0008d271 main + 116
21 libdyld.dylib 0x3b022ab7 <redacted> + 2
)
错误表示您正在调用[ImageView layout],但此类(ImageView)中未声明layout方法。您必须在ImageView类中声明layout方法,或者必须删除该调用。由于您是iOS开发新手,我将概括回答 您看到该特定错误的原因有两个:
为了进一步说明,我们需要查看ImageView,它似乎是一个自定义类。但在此之前,您可能需要调试并找出ImageView在运行时的值,或者通过探查器运行应用程序并确保没有僵尸。具体问题如下:
[((TableView *)subView).layout invalidateLayout];
您正在将
子视图
转换为表视图
,但它实际上是一个图像视图
。我猜mViewType
不会返回您期望的值。您仔细阅读了错误消息吗<代码>原因:'-[ImageView布局]:未识别的选择器发送到实例0x1886f650@Neeku:是的,我发送了。这是什么意思?我是IOS开发新手。如果您详细说明问题的原因,这会很有帮助。您是否检查了它在哪一行崩溃???@hussainShabbir:它在[super LayoutSubview]崩溃
[((TableView *)subView).layout invalidateLayout];