Passing allocated dictionaries through UITableView
Hey all,
I am parsing an RSS feed into a UITableView. In my cellForRoawAtIndex I put all of the parsed data into the cells. After I put them in I do some string manipulation to actually go through and pull out a specific word from the parsed feed. I am trying to store that word in an NSMutableDictionary. I declared my NSMutableDictionary as an ivar. The following code is what I do in the viewDidLoad
now in my cellForRowAtIndex i have an if statement which pretty much says if the text I'm looking for was found with the rangeOfString method (and then I do the proper methods for that inside the if) now also within the if once I get my specific word, I want to store it in the dictionary and replace the key name in the myKeys array (the key being the word I found, lets just say it was test5) and then switching its corresponding object (in myObjects) "N" to I. See the code below
Code:
[myDictionary setObject:@"I" forKey:wordKey];
wordKey is a string that contains the word I found. I get an EXC_BAD_ACCESS when I get to that line...
Hey all,
I am parsing an RSS feed into a UITableView. In my cellForRoawAtIndex I put all of the parsed data into the cells. After I put them in I do some string manipulation to actually go through and pull out a specific word from the parsed feed. I am trying to store that word in an NSMutableDictionary. I declared my NSMutableDictionary as an ivar. The following code is what I do in the viewDidLoad
now in my cellForRowAtIndex i have an if statement which pretty much says if the text I'm looking for was found with the rangeOfString method (and then I do the proper methods for that inside the if) now also within the if once I get my specific word, I want to store it in the dictionary and replace the key name in the myKeys array (the key being the word I found, lets just say it was test5) and then switching its corresponding object (in myObjects) "N" to I. See the code below
Code:
[myDictionary setObject:@"I" forKey:wordKey];
wordKey is a string that contains the word I found. I get an EXC_BAD_ACCESS when I get to that line...
Any help would be appreciated
Fixed. I was returning a nil value because NSDictionary performs an autorelease. Just had to set the property to nonatomic, retain and synthesize it