NSCFType的这个iOS异常是什么? [英] What is this iOS exception with NSCFType?

查看:133
本文介绍了NSCFType的这个iOS异常是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码有时候有时会抛出以下异常。这个错误与内存管理有关吗?我要找什么?代码稍后指定。帮助赞赏感谢

My code works some times but at times throws the following exception. Is this error related to memory management? What do I look for? The code is specified later. Help appreciated. Thanks

iNMV [1067:307]
- [__ NSCFType stringByAppendingString:]:无法识别的选择器发送到实例0x10dc90。

iNMV[1067:307] -[__NSCFType stringByAppendingString:]: unrecognized selector sent to instance 0x10dc90.

iNMV [1067:307]异常:捕获NSInvalidArgumentException:
- [__ NSCFType stringByAppendingString:]:发送到实例0x10dc90的无法识别的选择器

iNMV[1067:307] Exception: Caught NSInvalidArgumentException: -[__NSCFType stringByAppendingString:]: unrecognized selector sent to instance 0x10dc90

NSString *url      = [realURLArray objectAtIndex:page * [svc maxNumberOfImages] + i];
NSString *thumbUrl = [url stringByAppendingString:@".128x128.jpg"];


推荐答案

添加断点objc_exception_throw - [NSException raise] malloc_error_break (我为所有项目设置这些)。然后调试你的应用程序(使用断点运行),当遇到这个异常时,找到代码块并检查变量的值。

Add breakpoints for objc_exception_throw, -[NSException raise], and malloc_error_break (I set these for all projects). Then debug your app (run with breakpoints enabled) and when your encounter that exception, find your block of code and inspect the values of your variables.

另外,你确定关于数学?如果您的页码从1开始,您每页10张图像,您想要的图像在i = 5,那么您的数学将会给您图像15,而不是图像5。

Also, are you sure about the math? If your page numbers start at 1, you have 10 images per page, and you want the image at i=5, then your math is going to give you image 15, not image 5.

这篇关于NSCFType的这个iOS异常是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆