varmab / flyinstyle

Flyinstye
1 stars 0 forks source link

Issues discovered at Hackathon. #232

Open korinis opened 10 years ago

korinis commented 10 years ago

Below are 17 coding issues discovered by the developers during the Hackathon. Some are serious - some are recommendations only ... some are relatively easy fixes - some will require more work.

Please have your team review these and let us know how you want to proceed.

  1. Loading of custom cells Currently the app uses
    cell = [[[NSBundle mainBundle] loadNibNamed:@"AirPortListCustomCell" owner:self options:nil] objectAtIndex:0];

Recommend using the following options instead option 1: Use storyboard and design the custom cell inline option 2: - (void)registerNib:(UINib )nib forCellReuseIdentifier:(NSString )identifier it's available since iOS 5

  1. Replace networking framework. ASIHTTPRequest is not supported since 2011. Use AFNetworking framework's AFHTTPSessionManager instead.
  2. No need for SBJSON Apple has a built in JSON serializer called NSJSONSerialization. It's available since iOS 5. As an alternative you could use Github's Mantle framework to convert between Model objects and JSON.
  3. Use CocoaPods to add external frameworks. It's easier to organize and maintain them.
  4. Instead of using multiple view controllers in a single XIB file (OffersViewController), use - (void)addChildViewController:(UIViewController *)childController and load them on-demand.
  5. Code/resources could be organization into physical folders. It's a good practice to create folders to back XCode groups. Always use relative path instead of absolute.
  6. Repos should always contain .gitignore files
  7. Lot of commented out code. That's either a leftover from some other code or they are not sure if they need that code later. We need to remove them.
  8. Excessive use of NSLog. Use DLog and ALog instead.
  9. Over 300 warnings. Warnings should be handled as errors. Lot of unimplemented protocols and use of deprecated enums/methods.
  10. Lack of keywords before all arguments. -(void)sharedSocialServiceStatus:(NSString )dealId:(NSString )userId:(NSString )airportID:(NSString )sharedString

should be -(void)sharedSocialServiceStatus:(NSString )dealId userId:(NSString )userId airPortID:(NSString )airportID sharedString:(NSString )sharedString

See https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html#//apple_ref/doc/uid/20001282-BCIGIJJF

  1. Too much code in the application delegate. Core location, beacon, keychain manager etc. They do not belong there. Move it to a separate classes.
  2. properties are auto synthesized, so @synthesize is no longer needed.
  3. IBOutlets should be declared as weak.
  4. Use Objective-C literals self.categoryImagesArray=[[NSMutableArray alloc] initWithObjects:@"all_icon",@"drink_icon",@"dutyfree_icon",@"family_icon",@"food_icon",@"newsstand_icon",@"services_icon",@"shopping_icon",@"setting_icon",@"favourites_icon",nil]

can be written as self.categoryImagesArray= @["all_icon",@"drink_icon",@"dutyfree_icon",@"family_icon",@"food_icon",@"newsstand_icon",@"services_icon",@"shopping_icon",@"setting_icon",@"favourites_icon"]

airportsList.Longitude=[mainDict objectForKey:@"Longitude"]; is equivalent with airportsList.Longitude=mainDict[@"Longitude"];

  1. Use of separate xib files for 3.5 and 4 inches display. It's not wrong per se, but apple will release new display sizes soon, so I would suggest using autolayout instead.
  2. Lack of localization. It's gonna be important once you go international Use NSLocalizedString