From 76ae2840633d25c56a911724ef93922187ebfcba Mon Sep 17 00:00:00 2001 From: kayanouriko Date: Wed, 8 Mar 2017 17:06:04 +0800 Subject: [PATCH] fix bug --- ExReadViewer/QJTagMainViewController.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ExReadViewer/QJTagMainViewController.m b/ExReadViewer/QJTagMainViewController.m index eb533ed..fb46edd 100644 --- a/ExReadViewer/QJTagMainViewController.m +++ b/ExReadViewer/QJTagMainViewController.m @@ -82,8 +82,16 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; + BOOL isExHentai = [[[NSUserDefaults standardUserDefaults] objectForKey:@"ehentaiStatus"] boolValue]; + NSString *url = self.datas[indexPath.row][@"tagUrl"]; + if (isExHentai) { + url = [url stringByReplacingOccurrencesOfString:@"e-hentai" withString:@"exhentai"]; + } + else { + url = [url stringByReplacingOccurrencesOfString:@"exhentai" withString:@"e-hentai"]; + } QJTagViewController *vc = [QJTagViewController new]; - vc.mainUrl = self.datas[indexPath.row][@"tagUrl"]; + vc.mainUrl = url; vc.tagName = self.datas[indexPath.row][@"tagName"]; [self.navigationController pushViewController:vc animated:YES]; }