gpt4 book ai didi

ios - class_copyIvarList 泄漏

转载 作者:行者123 更新时间:2023-11-28 22:20:25 26 4
gpt4 key购买 nike

- (NSMutableArray *)getArrayValue:(NSArray *)array{
NSMutableArray *valueArray = [NSMutableArray array]; //value数组
for (NSObject *object in array) {
unsigned int numberofIvars = 0;
Ivar* ivars = class_copyIvarList([object class], &numberofIvars);
NSMutableArray *objectArray = [NSMutableArray array];
for(const Ivar* p = ivars; p< ivars+numberofIvars;p++){
Ivar const ivar = *p ;
NSString* key = [NSString stringWithUTF8String:ivar_getName(ivar)];
NSString *value = [object valueForKey:key];
[objectArray addObject:value];
}
[valueArray addObject:objectArray];
}
return valueArray;
}

我在使用此方法时发生内存泄漏。
我该怎么办?

最佳答案

关于ios - class_copyIvarList 泄漏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20566490/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com