Subversion Repository Public Repository

Nextrek

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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//
//  IndiceVC.m
//  Foresta
//
//  Created by Fabrizio on 18/12/12.
//  Copyright (c) 2012 Odyssey. All rights reserved.
//

#import "IndiceVC.h"
#import "IndiceCell.h"
//#import "ReaderVC.h"

@interface IndiceVC ()

@end

@implementation IndiceVC

@synthesize indiceItems;
@synthesize backToChapterBtn;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}

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

- (void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    backToChapterBtn.hidden = !DATAMANAGER.isReading;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void) createIndiceItems {
    indiceItems = [NSMutableArray array];
    
    [indiceItems addObject:@"LA BALLATA DEI MOSTRI"];
    [indiceItems addObject:@"IL MULIGNO"];
    [indiceItems addObject:@"LA PASITA"];
    [indiceItems addObject:@"L'ONNO"];
    [indiceItems addObject:@"IL MANGIAMANI"];
    [indiceItems addObject:@"IL TARASSO"];
    [indiceItems addObject:@"LO STRAMBUTO"];
    [indiceItems addObject:@"LE PARURE"];
    [indiceItems addObject:@"LA GNORGNIA"];
    [indiceItems addObject:@"LA NAMASTEA"];
    [indiceItems addObject:@"IL MOSTRO SENZA NOME"];
}

#pragma mark -
#pragma mark IBAction

- (IBAction)doBack {
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark -
#pragma mark Table view methods

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [indiceItems count];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	return 55;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *MyIdentifier = @"IndiceCell";
	
	IndiceCell *cell = (IndiceCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
	if (cell == nil)	{
		NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:MyIdentifier owner:self options:nil];
		cell = [topLevelObjects objectAtIndex:0];
	}
    
    [cell setGrayAndWhiteAlternateRow:indexPath.row];
    
    NSString *stringForCell = [indiceItems objectAtIndex:indexPath.row];
    cell.cellLabel.text = stringForCell;
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    [self.navigationController pushViewController:[DATAMANAGER backToReaderView:indexPath.row] animated:YES];
    
//    ReaderVC *vc = nil;
//    
//    if (DATAMANAGER.readerVC) {
//        vc = DATAMANAGER.readerVC;
//        vc.indexNumber = indexPath.row;
//        
//    }
//    else {
//        vc = [[ReaderVC alloc]initWithIndex:indexPath.row];
//        DATAMANAGER.readerVC = vc;
//    }
//    
////    ReaderVC *readerVC = [[ReaderVC alloc]initWithIndex:indexPath.row];
////    [self.navigationController pushViewController:readerVC animated:YES];
//    
//    [self.navigationController pushViewController:vc animated:YES];
	
    [tableView deselectRowAtIndexPath:[tableView indexPathForSelectedRow] animated:NO];
}

- (IBAction)doBackToChapter {
    [self.navigationController pushViewController:[DATAMANAGER backToReaderView:DATAMANAGER.readingChapter] animated:YES];
}


@end

Commits for Nextrek/iOS/Emmanuele Rossi/Mostri/Mostri/VC/IndiceVC.m

Diff revisions: vs.
Revision Author Commited Message
67 FAquili picture FAquili Thu 23 Jan, 2014 14:31:55 +0000

Emmanuele Rossi apps
- mostri
- trikster
- trivagolando