Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

1458279

Suspended
Original poster
May 1, 2010
1,601
1,521
California
Has anyone made a custom macro within Xcode?

Some editors of the past have offered a language and support to customize the editor. You could define a key to invoke a custom routine to do something like insert a dated comment.

Example: If you wanted to make a note to self, you could press a key like F8 and have it insert documentation that you wanted instead of typing it out.
Something like:
/* #Date#
*/

I see this from SO:

http://stackoverflow.com/questions/5013332/how-to-create-custom-text-macros-in-xcode

It has an example like this:

{
Identifier= objc.flog;
BasedOn= objc;
OnlyAtBOL= YES;
IsMenuItem= YES;
Name="Function (NSLog)";
TextString="NSLog(@"FUNCTION:%s", _FUNCTION_)";
CompletionPrefix="flog";
}

What I'd like to see is some documentation on this, maybe a chapter in a book or something that would show all the details.

The link from the SO answer goes here:
http://blog.ablepear.com/2010/01/code-completion-in-xcode-how-to-make.html

However, it's about 6 years old :D

Even the SO link is about 5 years old. Maybe someone has done some of these of knows of a tutorial site or something.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.