This template includes a delegate and a protocol and some private methods for communicating with the delegate. Now, when I have lots of NSOperation subclasses in a single project, I'll actually move much of this stuff to an abstract parent class or a category on NSOperation, but templates don't have any way of setting up dependencies, so I've made this self-contained and you can do your own refactoring.
I added this particular template under the Objective-C class icon so that it comes up as a new option under the Subclass of popup menu.
You can find the template files right here. The zip file contains the full path to install everything in the correct place, so if you want to install it so that you can use it from Xcode, you would use the following command:
unzip NSOperationTemplate.zip -d /
If you just unzip it regularly, you'll find the actual files nested several folders down as a result of the path information.
I've only touched one existing file, which is a property list that causes the new template to show up in Xcode's Subclass of dropdown menu. The rest are new files, so installing this shouldn't interfere with Xcode in any way. But caveat emptor. You do keep good backups, right?
Hopefully this will be useful to some of you. If you have suggestions for making it better, please let me know.
0 komentar:
Posting Komentar