@property (nonatomic,strong) NSMutableArray *messages;
- (NSMutableArray *)messages
{
if (_messagess ==nil) {
NSString *fullPath = [[NSBundlemainBundle]pathForResource:@"messages.plist"ofType:nil];//获取Plist的地址
NSArray *dictArray = [NSArrayarrayWithContentsOfFile:fullPath];//根据plist地址 把数据存入数组中
NSMutableArray *models = [NSMutableArrayarrayWithCapacity:dictArray.count];//新建一个可变数组存放plist转成的模型
for (NSDictionary *dict in dictArray) { //在数组中循环查找NSDictionary *对象
// 创建数据模型
JMgessageModle *messagea = [JMgessageModle modeWithDict:dict];//调用modeWithDict类方法把找出来得字典对象转成数据模型
[models addObject:messagea];//把转换好的数据模型存入可变数组
}
self.messages = [models copy];
}
return _messages;
}