I have a function meant for an iOS app. The NSString value
and key
contain the value and key however it doesnt seem to get assign to the NSMutableDictionary data
on the line [data setValue:value forKey:key]
-(NSMutableDictionary *)parseCode:(NSString *)string{
NSArray *array = [string componentsSeparatedByString:@"||"];
NSMutableDictionary *data;
for(id object in array){
NSArray *objectAndKey = [object componentsSeparatedByString:@"::"];
NSString *key =[objectAndKey objectAtIndex:0];
NSString *value = [objectAndKey objectAtIndex:1];
[data setValue:value forKey:key];
[self alertMeWithString:[data valueForKey:key]];
}
return data;
}