Been working on a maintenance job which fortunately is paid hourly. I was trying to track down a lovely bad access crash on a pre-ARC iOS build, and came across a mysterious source folder in XCode just called "object". Within this folder was a definition for an interface called 'MyObject'. How descriptive!
@interface MyObject : NSObject {
NSDate *myDate;
NSData *myData;
NSString *_from;
NSString *_to;
NSInteger locationID;
}
That's the entire thing. Searching through the rest of the source files to find where this bloody thing is used, I come across a couple of declarations which look like:
MyObject *object;
That's right, an instance of MyObject called object. Results in this kind of lovely readable code:
object = [[MyObject alloc]init];
object.myDate = [NSDate date];
object._from = tmpLocation.startPoint;
object._to = tmpLocation.endPoint;
object.locationID = tmpLocation.serverdbID;
All of which is, of course, buried in the middle of 50-line procedures and uncommented. WHAT DOES IT DO?!?!?!