开发者

Is XCode able to implement Code Sense when conforming to a protocol?

开发者 https://www.devze.com 2022-12-21 02:27 出处:网络
So XCode has been driving me crazy.. When writing iPhone apps using pickers or table views, when I state that the controller conforms to the DataSource and Delegate methods, XCode isn\'t generating co

So XCode has been driving me crazy.. When writing iPhone apps using pickers or table views, when I state that the controller conforms to the DataSource and Delegate methods, XCode isn't generating code sense for those respective methods, and it's driving me nuts given how wordy some of them are..

Like -(NSInteger) tableView: (UITableView *) tableView indentationLevelForRowAtIndexPath: (NSIndexPath *) indexPath;

..I don't want to have to type that out every time I implement that. Is there a setting I've missed, or does XCode not dive into a protocol after you state you conf开发者_开发问答orm to it to generate code sense?


Not now, apparently.


I am looking into this right now. I am also baffled as to why there are not snippets for all the major delegate things you are going to use 10 ways to Sunday. I did a snippet recently for UITableViewDataSourceDelegate and that is very worthwhile. Wasted a bunch of time trying to get an Edit Menu to popup on a collection view cell last night that ended up being delegate methods in the docs not having the exact required syntax.

It is super clear how this should work. Two choices (not either/or, both should be supported):

  1. As you say, I declare myself a delegate, I put in the - and start typing the method name, there should be a completion.
  2. When Xcode notes that I have an incomplete implementation, in general, not just of delegates, it should have a quickfix to add stubs for chrissakes. That would take them no time to implement.

This is the last area in which eclipse really trounces Xcode. I don't understand the reluctance to just slam the door on this once and for all.

0

精彩评论

暂无评论...
验证码 换一张
取 消