I am new iOS development but I know android at eclipse. For example I am lack a package, I can use ctrl+shift+o to import the package,if there is shortcut key at Xcode can help to import the .h
file. Because sometimes I do not know my methods from which .h
file.
you know when I add new Delegate to .h
file,how to use shortcut key help me to add the need implement methods.
3 回答
You don't have that in Xcode, and honestly, at least in my perspective, I never really had the need to have it (and I am coming from an Android background). If you know what class you are using, you just have #import
or @class
it. I prefer this way because it makes you aware of the dependencies between classes.
I don't know of any shortcut for that. But you can Option-Click the delegate in your source code to get QuickHelp and from there you can open the Documentation with a list of all the methods in the protocol.
And usually protocol methods start always the same. For instance UITableViewDelegate methods all start with tableView:
(like tableView:didSelectRowAtIndexPath:
). If you know that, and are only unsure about the rest, or the type of the parameters, you can simply start typing -tableView
at the beginning of a line and XCode will list all the possible methods for you.
A bit late, but a plugin will do the job for you: