tips & tricks of effective...use refactor method judiciously-(uitableviewcell...
TRANSCRIPT
![Page 1: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/1.jpg)
Tips & Tricks of
Effective iOS Developers
![Page 2: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/2.jpg)
BEN SCHEIRMAN @subdigital
![Page 3: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/3.jpg)
![Page 4: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/4.jpg)
Weekly Screencasts on iOS DEVELOPMENT
$9/month
![Page 5: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/5.jpg)
Tips & Tricks of
Effective iOS Developers
![Page 6: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/6.jpg)
?
Effective
![Page 7: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/7.jpg)
effective |iˈfektiv| adjective !
successful in producing a desired or intended result
![Page 8: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/8.jpg)
!
DEVELOPERSEffective
![Page 9: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/9.jpg)
!
DEVELOPERSFIX PROBLEMS
Effective
![Page 10: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/10.jpg)
!
DEVELOPERSWRITE CODE FASTER
Effective
![Page 11: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/11.jpg)
!
DEVELOPERSCONFIDENTLY REFACTOR
Effective
![Page 12: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/12.jpg)
!
DEVELOPERSWRITE BETTER CODE
Effective
![Page 13: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/13.jpg)
!
DEVELOPERSWRITE FEWER BUGS
Effective
![Page 14: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/14.jpg)
!
DEVELOPERSGET THINGS DONE
Effective
![Page 15: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/15.jpg)
!
DEVELOPERSSHIP BETTER SOFTWARE
Effective
![Page 16: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/16.jpg)
SHIP BETTER SOFTWARE
![Page 17: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/17.jpg)
ME?
![Page 18: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/18.jpg)
![Page 19: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/19.jpg)
I aspire to beEffective
![Page 20: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/20.jpg)
Objective-C Tips
![Page 21: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/21.jpg)
Always use braces for conditionals
if ([self isHungry]) {
[self eatBurger];
}
if ([self isHungry])
[self eatBurger];
if ([self isHungry])
[self eatBurger];
[self takeNap];
if ([self isHungry]) {
[self eatBurger];
[self takeNap];
}
![Page 22: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/22.jpg)
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
goto fail;
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
goto fail;
...
!fail:
SSLFreeBuffer(&signedHashes);
SSLFreeBuffer(&hashCtx);
return err;
Always use braces for conditionals
![Page 23: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/23.jpg)
![Page 24: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/24.jpg)
@interface Player
!- (void)moveLeft;
- (void)moveRight;
- (void)jump;
- (void)hit;
!@end
Use Class Continuations for Private Properties
@interface Player ()
@property CGFloat health;
@property Texture *texture;
@end
!@implementation Player
…
@end
Player.h Player.m
![Page 25: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/25.jpg)
Use Class Continuations for Private Properties
@interface ViewController ()
@property IBOutlet UILabel *label;
@end
!@implementation ViewController
…
@end
![Page 26: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/26.jpg)
Use intention revealing method names
- (NSDate *)nextDate:(NSDate *);
- (NSDate *)nextBillingDateAfterDate:(NSDate *);
![Page 27: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/27.jpg)
Name single parameter BOOL arguments
-(void)showPanel:(BOOL)animated;
[self showPanel:NO];
![Page 28: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/28.jpg)
Name single parameter BOOL arguments
-(void)showPanelAnimated:(BOOL)animated;
[self showPanelAnimated:NO];
![Page 29: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/29.jpg)
Add Comment Documentation to Public Methods
![Page 30: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/30.jpg)
- (void)viewDidLoad {
[self.fetchedResultsController performFetch:nil];
}
Lazily Initialize Properties
- (NSFetchedResultsController *)fetchedResultsController {
if (_frc == nil) {
_frc = [[NSFetchedResultsController alloc]
initWithFetchRequest: self.fetchRequest
...
]
}
! return _frc;
}
![Page 31: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/31.jpg)
Lazily Initialize Properties
- (NSFetchRequest *)fetchRequest {
if (_fetchRequest == nil) {
_fetchRequest = …
}
return _fetchRequest;
}
![Page 32: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/32.jpg)
Lazily Initialize Properties
- (void)didReceiveMemoryWarning {
self.fetchResultsController = nil;
self.fetchRequest = nil;
…
}
![Page 33: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/33.jpg)
Use Refactor Method judiciously- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)
indexPath {
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:@“cell”];
NSArray *peopleInSection = self.sections[indexPath.section];
Person *person = peopleInSection[indexPath.row];
cell.textLabel.text = [NSString stringWithFormat:@“%@ %@“, person.firstName,
person.lastName];
cell.detailTextLabel.text = person.email;
return cell;
}
![Page 34: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/34.jpg)
Use Refactor Method judiciously
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath {
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:@“cell”];
Person *person = [self personAtIndexPath:indexPath];
cell.textLabel.text = [NSString stringWithFormat:@“%@ %@“, person.firstName,
person.lastName];
cell.detailTextLabel.text = person.email;
return cell;
}
![Page 35: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/35.jpg)
Use Refactor Method judiciously
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath {
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:@“cell”];
Person *person = [self personAtIndexPath:indexPath];
cell.textLabel.text = person.fullName;
cell.detailTextLabel.text = person.email;
return cell;
}
![Page 36: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/36.jpg)
Use Refactor Method judiciously
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath {
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:@“cell”];
Person *person = [self personAtIndexPath:indexPath];
[self updateCell:cell forPerson:person];
return cell;
}
![Page 37: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/37.jpg)
Understand Dependencies
method1 method2
![Page 38: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/38.jpg)
Understand Dependencies
![Page 39: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/39.jpg)
Understand Dependencies
![Page 40: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/40.jpg)
Understand Dependencies
![Page 41: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/41.jpg)
Keep your dependencies in check
OO is your friend
![Page 42: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/42.jpg)
objc-dependency-visualizer
http://paultaykalo.github.io/objc-dependency-visualizer
![Page 43: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/43.jpg)
http://jomnius.blogspot.com/2012/01/dependency-graph-tool-for-ios-projects.html
![Page 44: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/44.jpg)
http://jomnius.blogspot.com/2012/01/dependency-graph-tool-for-ios-projects.html
![Page 45: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/45.jpg)
Reduce Dependencies by…
Loose Coupling Programming to interfaces
Dependency Inversion Reduce God Objects Reduce Singletons
![Page 46: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/46.jpg)
With Less Dependencies you can…
Refactor Change your mind
Change your implementation Add features
![Page 47: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/47.jpg)
“Ruthlessly modularize functionality. Design, implement, and package everything as if it were to be distributed as 3rd-party
code”
![Page 48: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/48.jpg)
“Ruthlessly modularize functionality. Design, implement, and package everything as if it were to be distributed as 3rd-party
code”
![Page 49: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/49.jpg)
Mattt Thompson
![Page 50: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/50.jpg)
Slim down your classes
![Page 51: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/51.jpg)
Slim down your classes
![Page 52: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/52.jpg)
Try to impose limits
![Page 53: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/53.jpg)
Challenge Yourself
Photograph by Mikey Schaefer
![Page 54: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/54.jpg)
Max LOC for .m: ~150
Max LOC for method: 4-5
Cesare Rocchi
![Page 55: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/55.jpg)
Automate it
![Page 56: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/56.jpg)
awk
![Page 57: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/57.jpg)
find "${SRCROOT}" \(-name "*.h" -or -name "*.m"\) -and \( -path "${SRCROOT}/Pods/*" -prune -o -print0 \) | xargs -0 wc -l | awk '$1 > 400 && $2 != "total" { for(i=2;i<NF;i++) { printf "%s%s", $i, " “ } print $NF ":1: warning: File more than 400 lines (" $1 "), consider refactoring." }'
http://matthewmorey.com/improved-xcode-build-phases/
![Page 58: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/58.jpg)
Xcode Tips
![Page 59: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/59.jpg)
Completing Methods
![Page 60: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/60.jpg)
“- ta”
![Page 61: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/61.jpg)
Label your views in Interface Builder
![Page 62: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/62.jpg)
Learn Keyboard Shortcuts
Photo credit: Wikipedia
![Page 63: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/63.jpg)
⌘0
![Page 64: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/64.jpg)
⌘⌥0
![Page 65: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/65.jpg)
⌘⇧J
![Page 66: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/66.jpg)
⌘⇧Y
![Page 67: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/67.jpg)
⌘⇧C
![Page 68: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/68.jpg)
⌘⌃J ⌘⌃←
![Page 69: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/69.jpg)
Jump in Assistant, back
![Page 70: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/70.jpg)
⌘⌃E (Edit all in Scope)
![Page 71: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/71.jpg)
⌃I (Re-indent selection)
![Page 72: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/72.jpg)
So many to learn
![Page 73: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/73.jpg)
Pick 2 you don’t know
![Page 74: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/74.jpg)
Deliberately Practice them
![Page 75: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/75.jpg)
Repeat.
![Page 76: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/76.jpg)
![Page 77: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/77.jpg)
Snippets
![Page 78: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/78.jpg)
Xcode / TextExpander
![Page 79: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/79.jpg)
“pns” @property (nonatomic, strong)
![Page 80: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/80.jpg)
“propint” @property (nonatomic, assign) NSInteger
![Page 81: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/81.jpg)
“propstr” @property (nonatomic, copy) NSString *
![Page 82: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/82.jpg)
“mark” #pragma mark -
![Page 83: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/83.jpg)
#pragma mark 🙈🙉🙊
![Page 84: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/84.jpg)
#pragma mark 💩
![Page 85: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/85.jpg)
“tvds”
![Page 86: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/86.jpg)
“swf”
![Page 87: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/87.jpg)
“tvdel”
![Page 88: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/88.jpg)
“networkact” [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
![Page 89: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/89.jpg)
Repetitive code? Boilerplate code?
!
Make a snippet.
![Page 90: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/90.jpg)
Source Control Tips
![Page 91: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/91.jpg)
(git)
![Page 92: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/92.jpg)
Use the command
line
![Page 93: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/93.jpg)
Leverage GUIs for specific tasks
![Page 94: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/94.jpg)
http://rowanj.github.io/gitx/GitX
![Page 95: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/95.jpg)
Commits aren’t just ⌘S
![Page 96: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/96.jpg)
Commit in logical chunks.
![Page 97: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/97.jpg)
Write a good commit message
![Page 98: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/98.jpg)
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
Capitalized, short (50 chars or less) summary !More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together. !Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." This convention matches up with commit messages generated by commands like git merge and git revert. !Further paragraphs come after blank lines. !- Bullet points are okay, too !- Typically a hyphen or asterisk is used for the bullet, followed by a single space, with blank lines in between, but conventions vary here !- Use a hanging indent
![Page 99: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/99.jpg)
$ git log --oneline !9511f6c Add mixpanel gem 47a3e6d Add a sleep to not get throttled by facebook ce30dcb Kick Jenkins build 2e6802f Merge pull request #981 from DeliRadio/venue-favorites-rabls 99eb628 stub master account to avoid fail when run in test suite. b4e0435 before(:all) -> before(:each) to avoid certain test to fail when execute e4b10b6 Update schema 7b1e053 Fix banner check for venues in autocomplete 83ca7cb Update ci reporter 6eae32f Fix admin manages events spec. 7c8902b Add new line at the end of file so Github likes it. a153a48 Call Rails.application.eager_load! right before it is needed so that its 4a4d050 Refactoring test so it finishes faster. 4155ac6 fix crash when correcting country code from geolocated params 08c5bdb Proper auth token generation for facebook login: 4efaf1e Venue needs to have shareable_id and shareable_type implementation. Defa a9cdd7a Implemented a test to check shareable_id and shareable_type. Since Favor 9e1e6c2 fix after_party task syntax dde3ae9 add after_party task to fill in fb birthdays where we can 6e99a74 Implemented tests to check renderability of all ActiveRecord instance th b174af9 Added four templates that are required for favoritable items. 07218a0 year_of_birth, not birth_year be562bf update attribs from fb even for existing users 29041f0 Add logging to facebook oauth responses
![Page 100: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/100.jpg)
![Page 101: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/101.jpg)
Branches are basically free
![Page 102: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/102.jpg)
![Page 103: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/103.jpg)
REBASELearn to
![Page 104: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/104.jpg)
master
origin/master
![Page 105: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/105.jpg)
master origin/master
![Page 106: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/106.jpg)
master
origin/master
MERGE METHOD “git pull” by default
![Page 107: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/107.jpg)
master origin/master
![Page 108: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/108.jpg)
master
origin/master
REBASE METHOD
![Page 109: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/109.jpg)
99% of the time you want !
git pull --rebase
![Page 110: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/110.jpg)
Make this the default
git config branch.autosetuprebase always
![Page 111: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/111.jpg)
Never rebase public branches
![Page 112: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/112.jpg)
git bisect
![Page 113: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/113.jpg)
![Page 114: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/114.jpg)
git bisect start
![Page 115: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/115.jpg)
git bisect bad
![Page 116: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/116.jpg)
git checkout HEAD~15
![Page 117: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/117.jpg)
git bisect good
![Page 118: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/118.jpg)
?
![Page 119: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/119.jpg)
git bisect bad
![Page 120: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/120.jpg)
git bisect bad
![Page 121: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/121.jpg)
![Page 122: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/122.jpg)
git bisect good
![Page 123: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/123.jpg)
![Page 124: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/124.jpg)
git bisect good
![Page 125: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/125.jpg)
![Page 126: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/126.jpg)
git bisect good
![Page 127: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/127.jpg)
![Page 128: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/128.jpg)
git bisect run <script>
![Page 129: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/129.jpg)
Oops, I made a git mistake!
![Page 130: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/130.jpg)
git reflog
![Page 131: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/131.jpg)
![Page 132: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/132.jpg)
Branch Per Feature
![Page 133: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/133.jpg)
Keep Master Releasable
![Page 134: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/134.jpg)
Don’t veer too far from working software
![Page 135: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/135.jpg)
“I attempt to keep the app in a working state as much as possible. That means test driving small changes, committing often, and only
hooking things up to the UI when I think they're ready…”
![Page 136: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/136.jpg)
“… If I'm not in a position to push my code at least every hour or so, I feel like I haven't broken my work down properly”
![Page 137: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/137.jpg)
Stew Gleadow
![Page 138: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/138.jpg)
http://collectorcare.blogspot.com/
![Page 139: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/139.jpg)
http://cobcottagegifts.com/
![Page 140: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/140.jpg)
Effective Habits
![Page 141: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/141.jpg)
“I'm not a great programmer; I'm just a good programmer with great habits.” !
- Kent Beck
![Page 142: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/142.jpg)
Keep an improvement list !
!
![Page 143: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/143.jpg)
Have a side project !
!
![Page 144: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/144.jpg)
Read Other People’s Code
![Page 145: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/145.jpg)
“I form opinions about the code I study. Not all of it is good. I want to reflect on why I
feel that way.”
![Page 146: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/146.jpg)
Jonathan Penn
![Page 147: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/147.jpg)
Learn how to ask for help
![Page 148: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/148.jpg)
![Page 149: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/149.jpg)
![Page 150: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/150.jpg)
Don’t ask !
Questions.5
![Page 151: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/151.jpg)
Ask !
Question.1
![Page 152: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/152.jpg)
Distill The
Problem
![Page 153: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/153.jpg)
Reduce Variables
![Page 154: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/154.jpg)
Also works for:
![Page 155: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/155.jpg)
“Before asking for advice, take a careful look at what you know and what you are looking to have answered. Often that will put you in a spot where you answer your own question.” ! !
![Page 156: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/156.jpg)
Daniel Steinberg
![Page 157: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/157.jpg)
![Page 158: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/158.jpg)
Program in other Languages
![Page 159: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/159.jpg)
“Don't just program in Objective C, make sure you regularly use another language. There is a lot we can learn from other technologies and communities” !
- Stew Gleadow ! !
![Page 160: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/160.jpg)
Write Tests.
![Page 161: Tips & Tricks of Effective...Use Refactor Method judiciously-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell](https://reader034.vdocuments.us/reader034/viewer/2022052007/601b0eb890c64c360c795cf2/html5/thumbnails/161.jpg)
Go Forth, and be
Effective