Xcode should autocomplete calls to
| Originator: | stevestreza | ||
| Number: | rdar://7648205 | Date Originated: | |
| Status: | Duplicate/5980431 | Resolved: | |
| Product: | Developer Tools | Product Version: | 3.2 |
| Classification: | Enhancement | Reproducible: | Not Applicable |
While coding Objective-C, I'll frequently need to call a superclass' implementation of a method. Routinely, I'll need to pass the same parameters that my method got passed to super's implementation. Therefore, this should be able to do using autocomplete.
When in an Objective-C .m file, and want to call a super's method, the first word I type is "super". When I type this, the autocomplete window should pop up with a recommendation for "super". If I select it, it should replace the "super" with the full line of code.
-------
For a method with this signature:
-(void)drawRect:(NSRect)aRect{ ... }
Invoking this "super" autocomplete should print:
[super drawRect:aRect];
-------
Similarly, for this signature:
-(NSString *)foo:(id)aFoo bar:(id)aBar baz:(id)someBaz{ ... }
Invoking "super"'s autocomplete should print one of these, possibly based on context:
NSString *value = [super foo:aFoo bar:aBar baz:someBaz];
or
[super foo:aFoo bar:aBar baz:someBaz];
------
This addition would significantly speed up coding, especially in situations where subclasses need to override a lot of methods, while still invoking super's implementation (such as UIViewController subclasses on iPhone, where methods like -viewWillAppear: and -viewDidAppear: are often overridden in subclasses).
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
+1
Rarely is there a case where I would call super without invoking the exact same method I am in. If it is not in the auto-suggest always, perhaps it can be made to do this when it it the first line in the method.
Duplicated with 7677298.
Duped with 7700089.