ios - 求大神看看这个bug的修复
大家讲道理
大家讲道理 2017-04-18 09:44:49
0
8
435

这个bug有时会出现,有时侯又好用,完全不知道从哪下手,遍历这个model的时候,也是大概遍历到20多个的时候才会崩溃。

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(8)
左手右手慢动作

for in traverse without modifying the traversed array. It is recommended to change it to array enumerateObjectsUsingBlock... method to traverse. This can be modified without crashing. I have encountered the same problem

刘奇

It’s not good to modify the array while traversing it...

伊谢尔伦

Modifying and deleting the array while traversing will definitely cause problems

伊谢尔伦

The traversed array cannot be changed during traversal

Peter_Zhu

According to the prompt, your HCFavoriteIconView does not have the nodeIndex attribute or method! If you want to make modifications while traversing the array, it is recommended to use enum to traverse

黄舟

When traversing array elements, it is normal logic to add the required elements to a variable array, and then assign the variable array back after traversing it

迷茫

HCFavoriteIconView没有nodeIndex, 或者你把nodeIndex发给了不存在这个方法的对象0x7e3930e0, you can use category to debug the reason:

@interface NSObject(testing)

- (NSString *)nodeIndex;

@end

@implementation NSObject(testing)

- (NSString *)nodeIndex{
    NSAssert(NO, @"class %@ has no method of nodeIndex", [self class]);
    return nil;
}

@end
阿神

The console output shows [HCFavoriteIconView nodeIndex], indicating that HCFavoriteIconView cannot access this nodeIndex. First, confirm that the nodeIndex of your object exists.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!