Skip to content

Commit

Permalink
fix save mark question
Browse files Browse the repository at this point in the history
LiSiYuan authored and LiSiYuan committed Nov 28, 2016
1 parent 0360db3 commit b42bf20
Showing 3 changed files with 22 additions and 10 deletions.
Binary file modified .DS_Store
Binary file not shown.
7 changes: 6 additions & 1 deletion LSYReader/LSYReader/Reader/CatalogVC/LSYMarkVC.m
Original file line number Diff line number Diff line change
@@ -54,7 +54,12 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:markCell];
}
cell.textLabel.text = [_readModel.marks[indexPath.row].recordModel.chapterModel stringOfPage:_readModel.marks[indexPath.row].recordModel.page];
if (_readModel.marks[indexPath.row].recordModel.chapterModel.type == ReaderEpub) {
cell.textLabel.text = _readModel.marks[indexPath.row].recordModel.chapterModel.epubString[_readModel.marks[indexPath.row].recordModel.page];
}
else{
cell.textLabel.text = [_readModel.marks[indexPath.row].recordModel.chapterModel stringOfPage:_readModel.marks[indexPath.row].recordModel.page];
}
cell.detailTextLabel.text = _readModel.marks[indexPath.row].recordModel.chapterModel.title;
return cell;
}
25 changes: 16 additions & 9 deletions LSYReader/LSYReader/Reader/Model/LSYChapterModel.m
Original file line number Diff line number Diff line change
@@ -38,15 +38,7 @@ +(id)chapterWithEpub:(NSString *)chapterpath title:(NSString *)title imagePath:(
[model paginateEpubWithBounds:CGRectMake(0,0, [UIScreen mainScreen].bounds.size.width-LeftSpacing-RightSpacing, [UIScreen mainScreen].bounds.size.height-TopSpacing-BottomSpacing)];
return model;
}
-(id)copyWithZone:(NSZone *)zone
{
LSYChapterModel *model = [[LSYChapterModel allocWithZone:zone] init];
model.content = self.content;
model.title = self.title;
model.pageCount = self.pageCount;
return model;

}

-(void)parserEpubToDictionary
{
NSMutableArray *array = [NSMutableArray array];
@@ -238,6 +230,19 @@ -(NSString *)stringOfPage:(NSUInteger)index
}
return [_content substringWithRange:NSMakeRange(local, length)];
}
-(id)copyWithZone:(NSZone *)zone
{
LSYChapterModel *model = [[LSYChapterModel allocWithZone:zone] init];
model.content = self.content;
model.title = self.title;
model.pageCount = self.pageCount;
model.pageArray = self.pageArray;
model.epubImagePath = self.epubImagePath;
model.type = self.type;
model.epubString = self.epubString;
return model;

}
-(void)encodeWithCoder:(NSCoder *)aCoder{
[aCoder encodeObject:self.content forKey:@"content"];
[aCoder encodeObject:self.title forKey:@"title"];
@@ -248,6 +253,7 @@ -(void)encodeWithCoder:(NSCoder *)aCoder{
[aCoder encodeObject:self.epubContent forKey:@"epubContent"];
[aCoder encodeObject:self.chapterpath forKey:@"chapterpath"];
[aCoder encodeObject:self.html forKey:@"html"];
[aCoder encodeObject:self.epubString forKey:@"epubString"];
/**
@property (nonatomic,copy) NSArray *epubframeRef;
@property (nonatomic,copy) NSString *epubImagePath;
@@ -270,6 +276,7 @@ -(id)initWithCoder:(NSCoder *)aDecoder{
self.epubContent = [aDecoder decodeObjectForKey:@"epubContent"];
self.chapterpath = [aDecoder decodeObjectForKey:@"chapterpath"];
self.html = [aDecoder decodeObjectForKey:@"html"];
self.epubString = [aDecoder decodeObjectForKey:@"epubString"];
// self.epubframeRef = [aDecoder decodeObjectForKey:@"epubframeRef"];

}

2 comments on commit b42bf20

@wkjCoder
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

图片不能显示啊,大神在吗

@GGGHub
Copy link
Owner

@GGGHub GGGHub commented on b42bf20 Dec 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#12

Please sign in to comment.