Autoimport callbacks of delegate in XCode (iOS)
as the tilte is possible autoimport or there is an option in xcode that allow to import all callba开发者_开发技巧cks of a delegate(as MKMapviewdelegate or other)?
I use this option in Eclipse (Java) to import getters/setters methods to access class variables.
Thanks in advance.
You can't really "import" accessors and mutators, you'd have to inherit them. They have to be created by @property and @synthesize directives or manually. You could declare that your class implements a protocol, but you'd still need to define properties and create accessors/mutators whether using @synthesize or manually.
Hope I understood your question properly. I don't think xcode has any way to automagically create properties to wrap specified instance variables. If it does then I haven't found it yet (which is possible).
The easiest way I've found is to just copy from the header file and add {}
(and optionally delete the semicolon; Objective-C allows a semicolon before the { for some reason).
Finally in Xcode 9.0 there is a "Fix import" feature to add stubs for missing protocol requirements.
精彩评论