-
Notifications
You must be signed in to change notification settings - Fork 0
/
VFLLibraryDataController.m
68 lines (53 loc) · 2.89 KB
/
VFLLibraryDataController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// VFLLibraryDataController.m
// View Fellows Library
//
// Created by Nicholas Barnard on 11/21/13.
// Copyright (c) 2013 NMFF Development. All rights reserved.
//
#import "VFLLibraryDataController.h"
#import "FellowsLibrary.h"
@interface VFLLibraryDataController ()
- (void)initializeDefaultDataList;
@end
@implementation VFLLibraryDataController
- (void)initializeDefaultDataList {
NSMutableArray *libraryList = [[NSMutableArray alloc] init];
self.masterLibraryList = libraryList;
NSArray *demoLibraries = [NSArray arrayWithObjects:@"American Institute of Architects Library", @"Arnold Library", @"Center for Sex Positive Culture Library", @"Coast Guard Museum Northwest Library", @"Cornish College library", @"Dorothy Stimson Bullitt Library", @"Historic Seattle Library", @"Frye Art Museum Library", @"Gallagher Law Library", @"Gordon Ekvall Tracie Music Library", @"Group Health Cooperative Medical Library", @"King County Hazardous Waste Library", @"King County Law Library", @"Lemieux Library", @"LGBT Library", @"McCaw Foundation Library of Asian Art", @"The Mountaineers Library", @"Municipal Research and Services Center Library", @"Museum of History and Industry Library", @"Northwest and Alaska Fisheries Science Centers Library", @"Northeast Seattle Tool Library", @"PNA Tool Library", @"Harl V. Brackin Library", @"Seattle Architecture Foundation Library", @"Seattle Children's Hospital Library and Information Commons", @"Seattle Public Library", @"Seattle Municipal Archives", @"Seattle School of Theology & Psychology library", @"Temple De Hirsch Sinai Library", @"University of Washington Libraries", @"West Seattle Tool Library", @"Walter Johnson Memorial Library", @"Washington Talking Book & Braille Library", @"ZAPP", nil];
NSArray *demoShelves = [NSArray arrayWithObjects:@"Fiction", @"Non Fiction", nil];
FellowsLibrary *newLibrary;
FellowsShelf *newShelf;
for(id curLibrary in demoLibraries){
newLibrary = NULL;
newLibrary = [[FellowsLibrary alloc] initWithName:curLibrary];
[self addLibraryWithLibrary:newLibrary];
for(id curShelf in demoShelves){
newShelf = NULL;
newShelf = [[FellowsShelf alloc] initWithName:curShelf WithLibrary:newLibrary];
[newLibrary addShelftoLibrary:newShelf];
}
}
}
- (void)addLibraryWithLibrary:(FellowsLibrary *)newLibrary {
[self.masterLibraryList addObject:newLibrary];
}
- (id) init {
if (self = [super init]) {
[self initializeDefaultDataList];
return self;
}
return nil;
}
- (FellowsLibrary *)objectInListAtIndex:(NSUInteger)theIndex {
return [self.masterLibraryList objectAtIndex:theIndex];
}
- (NSUInteger)countOfList {
return [self.masterLibraryList count];
}
- (void)setMasterLibraryList:(NSMutableArray *)newList {
if (_masterLibraryList != newList) {
_masterLibraryList = [newList mutableCopy];
}
}
@end