Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
Adding a method to return a single PhillyShareLocaiton object by Id
Browse files Browse the repository at this point in the history
  • Loading branch information
MattMorgis committed May 24, 2015
1 parent 4e1a8c8 commit 723c202
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ typedef void (^PhillyBikeShareFailureBlock) (NSError *error);
- (void)fetchAllLocationsWithSuccessBlock:(PhillyBikeShareSuccessBlock)successBlock
andFailureBlock:(PhillyBikeShareFailureBlock)failureBlock;

- (id)getPhillyBikeShareLocationById:(NSInteger)phillyBikeShareLocationId;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,15 @@ - (void)fetchAllLocationsWithSuccessBlock:(PhillyBikeShareSuccessBlock)successBl
[getAllDataCommand execute];
}

- (id)getPhillyBikeShareLocationById:(NSInteger)phillyBikeShareLocationId {

for (PhillyBikeShareLocation *location in self.phillyBikeShareLocations) {
if (location.kioskId == phillyBikeShareLocationId) {
return location;
}
}

return nil;
}

@end

0 comments on commit 723c202

Please sign in to comment.