Pregunta

G'Day Programmers, I am from Java background however I have just started learning C++ and Objective C. I was worried when I so lots of different coding style in third party Objective C code. But I am kind a stuck with a dilemma.

My dilemma is whether to use #pragma tags while coding iOS application? Does it considered to be a good practise? Or it is programmer's own choice to have those directive drop down links?

Your expertise and industry experience will be helpful,

Thanks


  • Content I searched on internet were mostly suggesting what #pragma does. But I couldn't find much information regarding whether it is considered to be good practise or not.
¿Fue útil?

Solución

I usually use #pragma to separate implementations, like:

#pragma mark UITableViewDelegate Methods

#pragma mark Custom functionality Methods

So i can look at the drop down menu and go directly to where i want.

Otros consejos

I also use

 #pragma mark - UISomeDelegate

or

 #pragma mark -

XCode separates methods list with a line in navigation bar:

Line above UISomeDelegate

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top