ashfurrow / C-41

C-41 is an application to help people develop film at home by providing a series of "recipes" for photographers to use.
MIT License
2.05k stars 368 forks source link

Keypath vs standarrt method calling #18

Closed skywinder closed 10 years ago

skywinder commented 10 years ago

Hi! Can you explain, why you call string trought @keypath? What the profit from this calling method? https://github.com/AshFurrow/C-41/blob/master/C-41/ASHMasterViewModel.m#L91 return [recipe valueForKey:@keypath(recipe, blurb)];

Why not just write return recipe.blurb ?

ashfurrow commented 10 years ago

Ah, it had something to do with Core Data. Since the recipe is a managed object, using valueForKey: does something slightly different than just calling the key's property itself. To be honest, I can't remember why I did that. It's probably safe just to call through to the blurb accessor.