{"action":"created","issue":{"url":"https://api.github.com/repos/CoderMJLee/MJExtension/issues/266","labels_url":"https://api.github.com/repos/CoderMJLee/MJExtension/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/CoderMJLee/MJExtension/issues/266/comments","events_url":"https://api.github.com/repos/CoderMJLee/MJExtension/issues/266/events","html_url":"https://github.com/CoderMJLee/MJExtension/issues/266","id":117727181,"number":266,"title":"数组里面放的是NSString等数据时返回的数组是NSArray而不是NSMutableArray","user":{"login":"maplelover","id":6849094,"avatar_url":"https://avatars.githubusercontent.com/u/6849094?v=3","gravatar_id":"","url":"https://api.github.com/users/maplelover","html_url":"https://github.com/maplelover","followers_url":"https://api.github.com/users/maplelover/followers","following_url":"https://api.github.com/users/maplelover/following{/other_user}","gists_url":"https://api.github.com/users/maplelover/gists{/gist_id}","starred_url":"https://api.github.com/users/maplelover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maplelover/subscriptions","organizations_url":"https://api.github.com/users/maplelover/orgs","repos_url":"https://api.github.com/users/maplelover/repos","events_url":"https://api.github.com/users/maplelover/events{/privacy}","received_events_url":"https://api.github.com/users/maplelover/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-19T02:27:12Z","updated_at":"2015-11-19T06:06:02Z","closed_at":null,"body":"+ (NSMutableArray *)mj_objectArrayWithKeyValuesArray:(id)keyValuesArray context:(NSManagedObjectContext *)context\r\n\r\n// 如果数组里面放的是NSString、NSNumber等数据\r\nif ([MJFoundation isClassFromFoundation:self]) return [NSMutableArray arrayWithArray:keyValuesArray];\r\n\r\n测试数据：\r\n@interface StatusResult : BaseObject\r\n@property (strong, nonatomic) NSMutableArray *stringArray;\r\n@end\r\n\r\nNSDictionary *dict = @{\r\n                           @\"stringArray\" : @[\r\n                                   @\"text\", @\"Nice weather!\", @\"Rose\", @\"nami.png\"\r\n                                   ]\r\n                           };\r\nStatusResult *result = [StatusResult mj_objectWithKeyValues:dict];\r\n\r\nlldb: p (BOOL)[result.stringArray isKindOfClass:NSMutableArray.class]\r\n\r\n另外发现个小问题，\r\nstringArray 使用NSMutableArray好像解析不出来，NSArray就ok\r\n\r\nPS：\r\n在mj_objectClassInArray中显式指定数组元素类型为NSString后，result.stringArray的确是NSMutableArray类型，以上测试是没指定的\r\n+ (NSDictionary *)mj_objectClassInArray\r\n{\r\n    return @{\r\n              @\"stringArray\": [NSString class]\r\n             };\r\n}\r\n"},"comment":{"url":"https://api.github.com/repos/CoderMJLee/MJExtension/issues/comments/157961074","html_url":"https://github.com/CoderMJLee/MJExtension/issues/266#issuecomment-157961074","issue_url":"https://api.github.com/repos/CoderMJLee/MJExtension/issues/266","id":157961074,"user":{"login":"maplelover","id":6849094,"avatar_url":"https://avatars.githubusercontent.com/u/6849094?v=3","gravatar_id":"","url":"https://api.github.com/users/maplelover","html_url":"https://github.com/maplelover","followers_url":"https://api.github.com/users/maplelover/followers","following_url":"https://api.github.com/users/maplelover/following{/other_user}","gists_url":"https://api.github.com/users/maplelover/gists{/gist_id}","starred_url":"https://api.github.com/users/maplelover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maplelover/subscriptions","organizations_url":"https://api.github.com/users/maplelover/orgs","repos_url":"https://api.github.com/users/maplelover/repos","events_url":"https://api.github.com/users/maplelover/events{/privacy}","received_events_url":"https://api.github.com/users/maplelover/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T06:06:02Z","updated_at":"2015-11-19T06:06:02Z","body":"fixed."}}