【发布时间】:2013-02-06 10:59:21
【问题描述】:
我在 XCode 4.6 中使用 iOS 6.1 SDK 创建了UITableView 项目,并将目标 sdk 设置为 5.1,当应用程序在 cellForRowAtIndexPath 函数中调用 dequeueReusableCellWithIdentifier 时,应用程序抛出异常,模拟器是 5.1,在模拟器6.x就可以了。
1:
[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: 无法识别的选择器发送到实例
2:由于未捕获的异常NSInvalidArgumentException,正在终止应用程序,原因:-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: 无法识别的选择器发送到实例
【问题讨论】:
-
粘贴更多cellForRowAtIndexPath的代码..
-
dequeueReusableCellWithIdentifier:forIndexPath 这个函数是在 ios6.0 中添加的,所以你不能在 ios5 中用这个代码运行应用程序
-
这是我的错。如果需要,我应该在 5.x 中使用不带 forIndexPath 的 dequeueReusableCellWithIdentifier,并在 6.x 及更高版本中使用 dequeueReusableCellWithIdentifier:forIndexPath:。
标签: iphone uitableview ios5.1 ios6.1