I came across few posts here related to what I am doing but I am working with some nested objects that I want to extract.
This is a sample of my returned data - https://gist.github.com/ryancoughlin/8043604
I have this in my header so far :
#import "TideModel.h"
@protocol TideModel
@end
@implementation TideModel
-(id)initWithDict:(NSDictionary *)json {
self = [super init];
if(self) {
self.maxheight = [dictionary valueForKeyPath:@"tide.tideSummaryStats.minheight"];
self.minheight = [dictionary valueForKeyPath:@"tide.tideSummaryStats.maxheight"];
self.tideSite = [dictionary valueForKeyPath:@"tide.tideInfo.tideSite"];
}
return self;
}
@end
I have declared a property
for each string and i am accessing it accordingly.
But what I have above doesn't work, maybe because it wont know what to drill in to correct?... Or will it?