Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alphabetize methods in implementation file by name

Tags:

xcode4

I am using XCode 4. I have a very long .m file with a lot of function implementation.

I'd like to sort the functions alphabetically by their name or by its return type or the same order in its .h file.

The purpose of this is to better organize my .m file. I recently rearranged the functions in its corresponding .h file and it would be great if their is an automatic way of sorting the function implementation the same way its ordered in the .h

Here is an example of what I have now.

Currently have.

.h file

-(void) a;
-(void) b;
-(void) c;

.m file

-(void) c;
-(void) a;
-(void) b;

I'd like .m to sort the same way .h is sorted. I really hope this is possible without me copy pasting. The file is thousands of lines long.

like image 468
Farzad A Avatar asked Mar 17 '26 00:03

Farzad A


1 Answers

If you hold down the command key while selecting the function popup in Xcode4 then the messages will be listed in alphabetical order.

Class messages(+) will be sorted before instance messages(-).

like image 65
Mark Avatar answered Mar 20 '26 15:03

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!