Skip to content
Snippets Groups Projects
Commit 05772ac1 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

sort models by name

parent d33e6a9c
No related branches found
No related tags found
No related merge requests found
......@@ -18,4 +18,6 @@
-(UIImage *) getPreview;
-(void) setPreview:(NSString *)path;
-(void) setUrl:(NSString *)url;
-(NSComparisonResult)compare:(Model *)p;
@end
......@@ -73,4 +73,9 @@
_url = [NSURL URLWithString:url];
}
-(NSComparisonResult) compare:(Model *)p
{
return [[self getName] compare:[p getName]];
}
@end
......@@ -29,6 +29,7 @@
}
}
}
[models sortUsingSelector:@selector(compare:)];
UIBarButtonItem *about = [[UIBarButtonItem alloc] initWithTitle:@"About" style:UIBarButtonItemStyleBordered target:self action:@selector(showAbout)];
[self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects: about, nil]];
......@@ -60,6 +61,7 @@
i--;
}
}
[models sortUsingSelector:@selector(compare:)];
[self.tableView reloadData];
[self.refreshControl endRefreshing];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment