Courses by Andreas

New About Yours API Help
604 bytes, Objective-C
#import "ViewController.h"

@interface ViewController ()

@property (nonatomic, strong) NSArray *courses;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupCourses];
}

- (void)setupCourses {
    NSNumber *obj1 = @(10);
    NSNumber *obj2 = @(10);
    NSNumber *obj3 = @(10);
    self.courses = @[obj1, obj2, obj3];
}

- (void)addCourse:(NSNumber *)course {
    NSMutableArray *courses = [self.courses mutableCopy];
    [courses addObject:course];
    self.courses = courses;
    [self.tableView reloadData];
}

@end
Pasted 11 months, 3 weeks ago — Expires in 14 days
URL: http://dpaste.com/1EEFASX