Permalink
Browse files

Some fixes

  • Loading branch information...
1 parent 73fa3b7 commit 6b538d864d4d420c77861b06954cbb6397a68f42 @deepwinter committed May 22, 2012
@@ -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;
@@ -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;
@@ -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;
}

0 comments on commit 6b538d8

Please sign in to comment.