我有一个NSObject
类,我也在其中发送一个NSDictionary
对象,然后类对象将所有条目设置NSDictionary
为它们的本机类型,这些本机类型是类中的变量NSObject
。
然后我想将这个NSObject
类传递给它自己的类,NSMutableArray
但是当这种情况发生时我的应用程序崩溃了。
下面是调用NSObject
Class 的代码,然后尝试将其设置为NSMutableArray
.
NSArray *filteredArray = parsedDataArrayOfDictionaries; //dictionary entries are currently in nsstring format
SearchResultList *searchResultList = [[SearchResultList alloc]init];
NSMutableArray *testArray = [[NSMutableArray alloc] init];
int myCount = 0;
while (myCount <= [filteredArray count]) {
//call class and pass current NSDictionary in array[myCount]
[searchResultList assignSearchData:filteredArray[myCount]];
searchResultList = (SearchResultList*)[testingDic objectForKey:@"myObject"];
testArray[myCount] = searchResultList; //create array of nsobjectclassed, this is also where the app fails
NSLog(@"%@", testArray[myCount]);
}
希望这是有道理的,我在while语句的中间有点迷失了......我知道我需要取回NSObject
Class然后将它分配给一个数组..但我只是不确定如何做到这一点,任何帮助将不胜感激。