Autocompletion level: Xcode

Working on an iOS contract application the other day, I happened to create a manager class for a data collection. The purpose of the manager was to bundle a table view data source in with other convenience methods for the array being managed (count, etc.). In the process, I stumbled across a pretty aggressive autocomplete suggestion.

The basic class header looks like the following:

@interface MyDataManager : NSObject
@property (nonatomic, strong) NSArray * collection;
- (id)initWithCollection:(NSArray *)collection;
@end

Here’s where the Xcode magic kicks in: beginning a method signature with the type NSUInteger and name count produces an autocomplete suggestion for the method countOfCollection. The toolchain will look at the existence of the property and infer that you want methods based on that collection - something beyond any other IDE I’ve seen.