Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Deepwinter committed May 22, 2012
1 parent 73fa3b7 commit 6b538d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
7 changes: 4 additions & 3 deletions Source/Views and Controllers/MapViewController.m
Expand Up @@ -220,9 +220,10 @@ - (void) addAnnotations {
//Cludgy way of removing all annotations
//Once we switch to liveQuery this will be changed
//TODO: Change when switch to live query
for (int i =0; i < [mapView.annotations count]; i++) {
if ([[mapView.annotations objectAtIndex:i] isKindOfClass:[RHMapAnnotation class]]) {
[mapView removeAnnotation:[mapView.annotations objectAtIndex:i]];
NSArray * annotations = mapView.annotations;
for (int i =0; i < [annotations count]; i++) {
if ([[annotations objectAtIndex:i] isKindOfClass:[RHMapAnnotation class]]) {
[mapView removeAnnotation:[annotations objectAtIndex:i]];
}
}
self.activeDocuments = nil;
Expand Down
17 changes: 6 additions & 11 deletions Source/Views and Controllers/ProjectsTableViewController.m
Expand Up @@ -103,6 +103,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.textLabel.text = aProject;
if([currentProject isEqualToString: aProject]){
cell.accessoryType = UITableViewCellAccessoryCheckmark;
// cell.selected = YES;
// cell.selected = NO;
}

return cell;
Expand Down Expand Up @@ -149,25 +151,18 @@ - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- (void)tableView:(UITableView *)currentTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
/*
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
*/
RHDataModel * rhDataModel = [RHDataModel instance];
rhDataModel.project = (NSString *) [self.projects objectAtIndex: [indexPath row]];

UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath];
UITableViewCell * cell = [currentTableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryCheckmark;
cell.selected = NO;
}

- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath];
- (void)tableView:(UITableView *)currentTableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell * cell = [currentTableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryNone;
}

Expand Down

0 comments on commit 6b538d8

Please sign in to comment.