My Nsdictionary looks like this.
{
thread = "{
\"uuid\": \"e9290344dee38c42782\",
\"site_full\": \"www.independent.co.uk\",
\"main_image\":\"http://www.independent.co.uk/incoming/article10498560.ece/binary/original/39-tea-party-ap.jpg\"
}";
}
[newDict valueForKeyPath:@"thread.main_image"];
I am trying to access it like that but it I can get all the other values which are outside the thread but cant the nested values in the thread.Any help is appreciated.
EDIT
for (int i=0;i < [responseObject count];i++) {
NSDictionary* newDict = (NSDictionary*)responseObject[i];
if ([(NSString*)[newDict valueForKey:@"title"] isEqualToString: @""] || [newDict valueForKey:@"title"]== Nil) {
NSLog(@"Image or Title Text is null");
}
else{
NewsFeed* newsData = [NewsFeed new];
newsData.newsSource = [newDict valueForKeyPath:@"thread.site"];
newsData.newsImageLink = [newDict valueForKeyPath:@"thread.main_image"];
//these three work fine
newsData.newsTitle = [newDict valueForKeyPath:@"title"];
newsData.newsText = [newDict valueForKeyPath:@"text"];
newsData.newsDate = [newDict valueForKeyPath:@"published"];
//
NSLog(@"news Source :: %@ \n and news ImageLink:: %@ \n news Title %@ \nnews Text:: %@ \n news Date:: %@ ",newsData.newsSource,newsData.newsImageLink,newsData.newsTitle,newsData.newsText,newsData.newsDate);
[NewsData addObject:newsData];
}
}