Can Xcode 4.2 auto-generate me the stubs for the protocols i defined in the header-file?
In this tutorial (http://kurrytran.blogspot.com/2011/10/ios-5-storyboard-and.html) in the note of point 4 the author says, Xcode will now auto generate the methods i need. Otherwise I did something wrong...
From your question, I can't understand exactly what you need.
If you need boilerplate code like the -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
implementation that comes when you subclass UITableViewController
, then you should create your own templates as Grouchal suggests. Also check a similar question I asked here.
I think that the tutorial you link to refers to code sense, for example:
<UITextFieldDelegate>
:@interface FirstViewController : UIViewController <UITextFieldDelegate>
Try the same with UITableViewDelegate
and UITableViewDataSource
, you will see that you'll get a similar result as the one at step 4 of your tutorial (note that in the screenshot, the user has already typed "-tab" to get the list of methods).
Check out Accessorizer if I'm not mistaken, it can do what you want.
Firstly you might want to look into using templates to achieve your goals:
http://blog.highorderbit.com/2009/03/15/customizing-xcode-cocoa-touch-file-templates/
The tutorial you have references also mentions in point 4:
Also note, if the method is not auto-generating you're probably doing something wrong. That's the main way I know I'm doing something wrong, or the program crashes.
This might indicate that you have not followed the previous steps 100%
If you create a new class through the Xcode wizard ( i.e. File->New->File or cmd-N and select Objective-C class ) then if you pick an appropriate built-in superclass from those in the 'Subclass Of' dropdown, you will get a template implementation with the essential stubs implemented, and commented-out versions of other methods, that you can base your code on. I've used this successfully for subclasses of UITableViewController. Not quite in the league of the Eclipse stub generation, but better than nothing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With