Created
January 22, 2014 08:22
-
-
Save addamh/8555253 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-01-22 02:21:25.094 ppd[31125:70b] -[PPDDealership copyWithZone:]: unrecognized selector sent to instance 0x1d773670 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (PPDDealership*)findPrimaryVehicle:(NSArray*)vehicles | |
{ | |
PPDVehicle* primary = [vehicles.rac_sequence objectPassingTest:^BOOL(PPDVehicle* vehicle) { | |
return [[vehicle primary] boolValue]; | |
}]; | |
return primary.dealership; | |
} | |
#pragma mark - Public Interface | |
- (void)loadVehiclesAndFindPrimaryDealership | |
{ | |
self.state = PPDServiceStateLoadingVehicles; | |
[[PPDApiClient sharedInstance] findVehiclesForCurrentUserWithSuccess:^(NSArray *vehicles) { | |
self.dealership = [self findPrimaryVehicle:vehicles]; | |
self.state = PPDServiceStateVehiclesLoaded; | |
} failure:^(NSInteger statusCode, NSError *error) { | |
self.state = PPDServiceStateStateErrorLoadingVehicles; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment