Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
Improvements based on feedback from Analyze build. Added CFRelease st…
Browse files Browse the repository at this point in the history
…atements on address and addresses value refs in SFLocalLegislatorsViewController. Corrected BOOL pointer assignment blocks in SFCommitteeSegmentedViewController, etc. Added super calls for viewDidLoad and viewWillAppear: overrides. Removed some unused variables.
  • Loading branch information
dcloud committed Feb 10, 2015
1 parent 782ab5d commit 8fbab61
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 17 deletions.
1 change: 1 addition & 0 deletions Classes/Controllers/SFActivitySectionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ - (void)viewDidLoad {
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
/*
BOOL isFollowingObjects = ([[self _getFollowedObjects] count] > 0);
CGRect contentRect = [self.view convertRect:_segmentedVC.segmentedView.contentView.frame fromView:_segmentedVC.segmentedView];
Expand Down
1 change: 1 addition & 0 deletions Classes/Controllers/SFBillDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ - (void)loadView {
}

- (void)viewDidLoad {
[super viewDidLoad];
[_billDetailView.linkOutButton addTarget:self action:@selector(handleLinkOutPress) forControlEvents:UIControlEventTouchUpInside];
[_billDetailView.sponsorButton addTarget:self action:@selector(handleSponsorPress) forControlEvents:UIControlEventTouchUpInside];
[_billDetailView.cosponsorsButton addTarget:self action:@selector(handleCosponsorsPress) forControlEvents:UIControlEventTouchUpInside];
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controllers/SFBillSegmentedViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ - (void)setVisibleSegment:(NSString *)segmentName;
{
NSUInteger segmentIndex = [_segmentedVC.segmentTitles indexOfObjectPassingTest: ^BOOL (id obj, NSUInteger idx, BOOL *stop) {
if ([segmentName caseInsensitiveCompare:(NSString *)obj] == NSOrderedSame) {
stop = YES;
*stop = YES;
return YES;
}
return NO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ - (void)viewDidAppear:(BOOL)animated {
id <GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker set:kGAIScreenName value:@"Committee Member List Screen"];
[tracker send:[[GAIDictionaryBuilder createAppView] build]];
[super viewDidAppear:animated];
}

#pragma mark - UITableViewDelegate
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controllers/SFCommitteeSegmentedViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ - (void)updateWithCommittee:(SFCommittee *)committee {
- (void)setVisibleSegment:(NSString *)segmentName {
NSUInteger segmentIndex = [_segmentTitles indexOfObjectPassingTest: ^BOOL (id obj, NSUInteger idx, BOOL *stop) {
if ([segmentName caseInsensitiveCompare:(NSString *)obj] == NSOrderedSame) {
stop = YES;
*stop = YES;
return YES;
}
return NO;
Expand Down
2 changes: 2 additions & 0 deletions Classes/Controllers/SFCommitteesSectionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ - (void)viewDidLoad {

- (void)viewWillAppear:(BOOL)animated {
[self update];
[super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated {
if (_restorationSelectedSegment != nil) {
[_segmentedController displayViewForSegment:_restorationSelectedSegment];
_restorationSelectedSegment = nil;
}
[super viewDidAppear:animated];
}

- (void)didReceiveMemoryWarning {
Expand Down
2 changes: 2 additions & 0 deletions Classes/Controllers/SFHearingsSectionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ - (void)viewDidLoad {

- (void)viewWillAppear:(BOOL)animated {
[self update];
[super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated {
if (_restorationSelectedSegment != nil) {
[_segmentedController displayViewForSegment:_restorationSelectedSegment];
_restorationSelectedSegment = nil;
}
[super viewDidAppear:animated];
}

- (void)update {
Expand Down
3 changes: 2 additions & 1 deletion Classes/Controllers/SFLegislatorDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ - (void)loadView {
}

- (void)viewDidLoad {
[super viewDidLoad];
[_legislatorDetailView.followButton sam_setTarget:self action:@selector(handleFollowButtonPress) forControlEvents:UIControlEventTouchUpInside];
_legislatorDetailView.followButton.selected = NO;

Expand Down Expand Up @@ -286,7 +287,7 @@ - (void)updateView {
- (void)handleSocialButtonPress:(id)sender {
NSString *senderKey = [[_socialButtons keysOfEntriesPassingTest: ^BOOL (id key, id obj, BOOL *stop) {
if ([obj isEqual:sender]) {
stop = YES;
*stop = YES;
return YES;
}
return NO;
Expand Down
3 changes: 2 additions & 1 deletion Classes/Controllers/SFLegislatorSegmentedViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ - (void)viewDidAppear:(BOOL)animated {
[self setLegislatorWithBioguideId:_restorationBioguideId];
_restorationBioguideId = nil;
}
[super viewDidAppear:animated];
}

- (void)didReceiveMemoryWarning {
Expand Down Expand Up @@ -208,7 +209,7 @@ - (void)setLegislator:(SFLegislator *)legislator {
- (void)setVisibleSegment:(NSString *)segmentName {
NSUInteger segmentIndex = [self.segmentTitles indexOfObjectPassingTest: ^BOOL (id obj, NSUInteger idx, BOOL *stop) {
if ([segmentName caseInsensitiveCompare:(NSString *)obj] == NSOrderedSame) {
stop = YES;
*stop = YES;
return YES;
}
return NO;
Expand Down
6 changes: 5 additions & 1 deletion Classes/Controllers/SFLocalLegislatorsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ - (void)viewDidAppear:(BOOL)animated {
}
}

- (void)viewDidDisappear:(BOOL)animatedd {
- (void)viewDidDisappear:(BOOL)animated {
[_locationManager stopUpdatingLocation];
[super viewDidDisappear:animated];
}

- (void)setupLayoutConstraints {
Expand Down Expand Up @@ -564,6 +565,9 @@ - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)p

[self moveAnnotationToAddress:(__bridge NSDictionary *)(address) andRecenter:YES];

CFRelease(addresses);
CFRelease(address);

return NO;
}

Expand Down
1 change: 1 addition & 0 deletions Classes/Controllers/SFVoteDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ - (void)loadView {
}

- (void)viewDidLoad {
[super viewDidLoad];
self.edgesForExtendedLayout = UIRectEdgeNone;
_voteDetailView = [[SFVoteDetailView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
_voteDetailView.translatesAutoresizingMaskIntoConstraints = NO;
Expand Down
2 changes: 0 additions & 2 deletions Classes/Style/SFCongressAppStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,12 @@ + (CGFloat)lineSpacing {
@implementation SFCongressAppStyle

+ (void)setUpGlobalStyles {
NSInteger statusBarStyleValue;
UITableView *tableViewStyle = [UITableView appearance];
tableViewStyle.sectionIndexColor = [UIColor primaryTextColor];

__weak UIWindow *window = [UIApplication sharedApplication].keyWindow;
window.backgroundColor = [UIColor primaryBackgroundColor];

statusBarStyleValue = UIStatusBarStyleLightContent;
tableViewStyle.sectionIndexBackgroundColor = [UIColor clearColor];
window.tintColor = [UIColor defaultTintColor];

Expand Down
6 changes: 1 addition & 5 deletions Classes/Transformers/SFDefaultBillCellTransformer.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ - (id)transformedValue:(id)value {
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterNoStyle];

NSString *lastAction = [NSString stringWithFormat:@"%@ on %@",
bill.lastAction.typeDescription,
[dateFormatter stringFromDate:bill.lastActionAt]];

lastAction = bill.lastAction.text;
NSString *lastAction = bill.lastAction.text;

cellData.detailTextLabelString = lastAction;
cellData.detailTextLabelNumberOfLines = 3;
Expand Down
5 changes: 0 additions & 5 deletions Classes/Views/SFTableCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,6 @@ - (void)layoutSubviews {
if (self.height < self.cellHeight) self.height = ceilf(self.cellHeight);
self.contentView.height = ceilf(self.cellHeight);

CGFloat pTop = floorf(self.textLabel.bottom);
if (self.detailTextLabel) {
pTop = floorf(self.detailTextLabel.bottom);
}

_cellHighlightImage.top = 0;
_cellHighlightImage.height = self.height - 1;

Expand Down

0 comments on commit 8fbab61

Please sign in to comment.