Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // PositionsViewController.m
- // mapsy2
- //
- // Created by student on 21.05.2013.
- // Copyright (c) 2013 pg. All rights reserved.
- //
- #import "PositionsViewController.h"
- @implementation PositionsViewController
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
- // Return the number of sections.
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- // Return the number of rows in the section.
- CSAppDelegate *del = [[UIApplication sharedApplication ] delegate];
- return del.locHandler.locArray.count;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *CellIdentifier = @"PositionCell";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
- CSAppDelegate *del = [[UIApplication sharedApplication ] delegate];
- CLLocation *l = [del.locHandler.locArray objectAtIndex:indexPath.row] ;
- NSString *str = [NSString stringWithFormat:@"%f,%f", l.coordinate.longitude, l.coordinate.latitude ];
- cell.textLabel.text = str;
- return cell;
- }
- - (void) viewDidLoad
- {
- [super viewDidLoad];
- [[NSNotificationCenter defaultCenter] addObserver: self selector:@selector(zmianaPozycji:) name:@"lokalizacja" object:nil];
- }
- -(void) zmianaPozycji:(NSNotification *)notification
- {
- [self.tableView2 reloadData];
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment