{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/1678","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1678/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1678/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1678/events","html_url":"https://github.com/realm/realm-cocoa/issues/1678","id":63266727,"number":1678,"title":"Default property value not working for NSData","user":{"login":"alekpopek","id":1382649,"avatar_url":"https://avatars.githubusercontent.com/u/1382649?v=3","gravatar_id":"","url":"https://api.github.com/users/alekpopek","html_url":"https://github.com/alekpopek","followers_url":"https://api.github.com/users/alekpopek/followers","following_url":"https://api.github.com/users/alekpopek/following{/other_user}","gists_url":"https://api.github.com/users/alekpopek/gists{/gist_id}","starred_url":"https://api.github.com/users/alekpopek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alekpopek/subscriptions","organizations_url":"https://api.github.com/users/alekpopek/orgs","repos_url":"https://api.github.com/users/alekpopek/repos","events_url":"https://api.github.com/users/alekpopek/events{/privacy}","received_events_url":"https://api.github.com/users/alekpopek/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/pending","name":"pending","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-20T17:11:26Z","updated_at":"2015-03-21T08:00:36Z","closed_at":"2015-03-21T08:00:36Z","body":"This is my simple RLMObject\r\n```\r\n//  Contact.h\r\n#import <Realm/Realm.h>\r\n\r\n@interface Contact : RLMObject\r\n\r\n@property NSString *firstName;\r\n@property NSString *lastName;\r\n@property NSData *photoData;\r\n\r\n@end\r\n```\r\n\r\n```\r\n//  Contact.m\r\n#import \"Contact.h\"\r\n\r\n@implementation Contact\r\n\r\n+ (NSDictionary *)defaultPropertyValues {\r\n    return @{@\"firstName\": @\"\",\r\n             @\"lastName\": @\"\",\r\n             @\"photoData\": [NSData data]};\r\n}\r\n\r\n@end\r\n\r\n```\r\n\r\nIn my controller the code below crashes with:\r\n```No value or default value specified for property 'photoData' in 'Contact'```\r\n\r\n\r\n```\r\n    NSData *photoData = nil;\r\n    [contact setPhotoData:photoData];\r\n\r\n    RLMRealm *realm = [RLMRealm defaultRealm];\r\n    [realm beginWriteTransaction];\r\n    [realm addObject:contact];\r\n    [realm commitWriteTransaction];\r\n```\r\n\r\nAnd this code below works perfectly\r\n```\r\n    NSData *photoData = nil;\r\n    [contact setPhotoData:photoData ? photoData : [NSData data]];\r\n\r\n    RLMRealm *realm = [RLMRealm defaultRealm];\r\n    [realm beginWriteTransaction];\r\n    [realm addObject:contact];\r\n    [realm commitWriteTransaction];\r\n```"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/84277180","html_url":"https://github.com/realm/realm-cocoa/issues/1678#issuecomment-84277180","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1678","id":84277180,"user":{"login":"alekpopek","id":1382649,"avatar_url":"https://avatars.githubusercontent.com/u/1382649?v=3","gravatar_id":"","url":"https://api.github.com/users/alekpopek","html_url":"https://github.com/alekpopek","followers_url":"https://api.github.com/users/alekpopek/followers","following_url":"https://api.github.com/users/alekpopek/following{/other_user}","gists_url":"https://api.github.com/users/alekpopek/gists{/gist_id}","starred_url":"https://api.github.com/users/alekpopek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alekpopek/subscriptions","organizations_url":"https://api.github.com/users/alekpopek/orgs","repos_url":"https://api.github.com/users/alekpopek/repos","events_url":"https://api.github.com/users/alekpopek/events{/privacy}","received_events_url":"https://api.github.com/users/alekpopek/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T08:00:36Z","updated_at":"2015-03-21T08:00:36Z","body":"Yes, Thank you."}}