{"action":"closed","issue":{"url":"https://api.github.com/repos/Mantle/Mantle/issues/636","labels_url":"https://api.github.com/repos/Mantle/Mantle/issues/636/labels{/name}","comments_url":"https://api.github.com/repos/Mantle/Mantle/issues/636/comments","events_url":"https://api.github.com/repos/Mantle/Mantle/issues/636/events","html_url":"https://github.com/Mantle/Mantle/issues/636","id":114217294,"number":636,"title":"NSDate format based on another property","user":{"login":"skartys","id":2861608,"avatar_url":"https://avatars.githubusercontent.com/u/2861608?v=3","gravatar_id":"","url":"https://api.github.com/users/skartys","html_url":"https://github.com/skartys","followers_url":"https://api.github.com/users/skartys/followers","following_url":"https://api.github.com/users/skartys/following{/other_user}","gists_url":"https://api.github.com/users/skartys/gists{/gist_id}","starred_url":"https://api.github.com/users/skartys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skartys/subscriptions","organizations_url":"https://api.github.com/users/skartys/orgs","repos_url":"https://api.github.com/users/skartys/repos","events_url":"https://api.github.com/users/skartys/events{/privacy}","received_events_url":"https://api.github.com/users/skartys/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Mantle/Mantle/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-30T07:32:55Z","updated_at":"2015-10-30T17:31:28Z","closed_at":"2015-10-30T17:31:28Z","body":"I have learned how to use the NSDateFormatter and NSValueTransformer to convert an array of date-time strings to an array of NSDate objects. But how can I setup the NSDateFormatter's date format based on a key from the dictionary. I want to use the value of key <strong><code>xaxisformat</code></strong> to configure the NSDateFormatter before processing the <strong><code>timedata</code></strong> array.\r\n\r\n\r\nMonthly\r\n\r\n```json\r\n{\r\n\t\"success\" : true,\r\n\t\"pnldata\" : [0, -0.428800, -0.250600, -0.027100],\r\n\t\"damdata\" : [0, -0.033998, -1.861188, -2.733984],\r\n\t\"xaxisformat\" : \"MM-dd-yyyy\",\r\n\t\"timedata\" : [\"12-31-2014 00:00\", \"01-02-2015 00:00\", \"01-05-2015 00:00\", \"01-06-2015 00:00\"]\r\n}\r\n```\r\n\r\nDaily\r\n\r\n```json\r\n{\r\n\t\"success\" : true,\r\n\t\"pnldata\" : [0, -0.428800, -0.250600, -0.027100],\r\n\t\"damdata\" : [0, -0.033998, -1.861188, -2.733984],\r\n\t\"xaxisformat\" : \"HH:mm\",\r\n\t\"timedata\" : [\"09:00\", \"09:01\", \"09:02\", \"09:03\"]\r\n}\r\n```\r\n\r\n"}}