Just make a directed graph out of cell references. Get the strongly connected components. All of the components with more than one vertex contain a loop and can't be computed. Remove those and you get a directed acyclic graph. Now you can topological sort them for cell dependencies, and start calculating them in the order they are needed.
Or if your language has a dataflow implementation it is even easier. Haven't seen one of these for Obj-C though.
I will add that this looks pretty cool, though.