Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ViewController.m
- // Labb3TodoList
- //
- // Created by Henrik Doré on 2020-01-20.
- // Copyright © 2020 Henrik Doré. All rights reserved.
- //
- #import "ViewController.h"
- #import "addNewTodoViewController.h"
- @interface ViewController ()
- @end
- @implementation ViewController
- @synthesize todoListArray;
- @synthesize todolistArrayNewFromUser;
- - (void)viewDidLoad {
- [super viewDidLoad];
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- NSMutableArray *todolistFromUser = [[defaults objectForKey:@"todoarrayKey"] mutableCopy];
- todolistArrayNewFromUser = todolistFromUser;
- }
- -(void)viewDidAppear:(BOOL)animated{
- [self ];
- [_tableView reloadData];
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
- return todolistArrayNewFromUser.count;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"cell"];
- if (cell == nil){
- cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
- }
- cell.textLabel.text = [todolistArrayNewFromUser objectAtIndex:indexPath.row];
- return cell;
- }
- - (IBAction)newtodoBtn:(id)sender {
- }
- - (IBAction)updateBtn:(id)sender {
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement