My experience is in Java development with Eclipse, where if I add a protocol in a header file there is a shortcut to add the required methods of that protocol in the implementation file. Does Xcode have a similar shortcut?
For example: In my .h, I define a class to conform to the UIPickerViewDelegate and UIPickerViewDataSource protocols.
@interface Something : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource> {
}
These protocols have required methods that I need to implement, and I am always checking the documentation to see which ones. Is there some method for Xcode to insert stubs for these required methods in the implementation file?
So you’re asking if, when you type an
@protocolcommand in an ObjC header file, can Xcode automatically put the@synthesizein the .m file?No. You have to do it manually. There is no built-in way to do this, although someone may have written a script to do that.