- (NSDictionary *)dataArrayFromJson {
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"decoration" ofType:@"json"];
NSString *jsonStr = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
if (jsonStr == nil) {
return nil;
}
NSData *jsonData = [jsonStr dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&error];
if (error) {
return nil;
}
return dic;
}