Xcode: Possible to auto-create stubs for methods required by Protocol interface?

后端 未结 10 1126
心在旅途
心在旅途 2020-12-13 08:41

Coming from an Eclipse / Java background, one of my favorite features is the ability to quickly stub out all the methods required by an interface. In Eclipse, I can choose

10条回答
  •  不知归路
    2020-12-13 09:23

    Based on AllanCraig's "Create @property, @synthesize & dealloc from Variable Declaration" ruby script, I made one to generate implementation stubs from interface ones: http://pastebin.com/4T2LTBh6

    How to use?

    • Setup the script on your XCode (Shell Script) and assign a shortcut for it (e.g. CMD+5).
    • Select lines from your interface file in which you want to generate the implementation, and press the hotkey.
    • Your .m will contain your selected methods.

提交回复
热议问题