Re: Create accessor methods quickly with BBEdit
Re: Create accessor methods quickly with BBEdit
- Subject: Re: Create accessor methods quickly with BBEdit
- From: Matt Neuburg <email@hidden>
- Date: Mon, 13 May 2002 10:15:48 -0700
On Sun, 12 May 2002 21:41:39 +0100, Matt Gemmell
<email@hidden> said:
>
Thought I'd share this, since I use it myself to speed things up when
>
creating a new object with several instance variables. I wrote a couple
>
of regular expressions find/replace operations in BBEdit 6.5 (these need
>
6.5 or later), to quickly create implementations of accessor methods
>
from their declarations
Yes, the first thing I noticed the very first day using Cocoa was that I
was going to go mad writing accessors, which can obviously be
machine-generated; I too immediately wrote a solution.
One is typically not using BBEdit to write code; one is using Project
Builder. So a BBEdit solution is inappropriate. What's needed is something
at system level - something that can somehow "see" an ivar declaration in
your text, munge it, and replace it with declarations or implementations
for the corresponding accessors. This munging requires regular expressions,
as you have rightly seen.
It happens that such a thing exists - the free JavaScriptOSA from LateNight
Software. (Shameless plug; I wrote the PDF documentation included with
this.) I have a couple of scripts in the omnipresent Scripts menulet that
read the text on the clipboard, munge it using regular expressions, and
replace it with the result. So my work method goes: select one or more ivar
declarations, and copy; choose the item from the Scripts menulet;
reposition the insertion point, and paste.
m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes gar anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.