As mentioned elsewhere, #pragmas inside methods don't work in Xcode 4.
What's a good way to do quick navigation to different sections within a long method, for example to specific cases of a switch statement?
(I try to keep methods clean & short where practical, but that's a topic for elsewhere.)
Not sure if this is exactly what you are looking for... What I like to do is to simply use code blocks like so:
// some code
{
// some code that should stay together
} // [a comment that explains what the code does]
This at least allows you to use Xcode's code folding: When you fold in the block between the two { }
, you get {...} // [your explanatory comment]
It is also great to limit the scope of variables and can (very) slightly improve memory efficiency.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With