From 94eddec0aeed10b05d80eaa81228cb8656ca8a26 Mon Sep 17 00:00:00 2001 From: georgeshen Date: Fri, 24 Jun 2016 17:24:09 +0800 Subject: [PATCH] fix bug of pathComponents from route --- .DS_Store | Bin 0 -> 6148 bytes HHRouter/HHRouter.m | 4 ++-- HHRouterExample/.DS_Store | Bin 0 -> 6148 bytes HHRouterExample/Images.xcassets/.DS_Store | Bin 0 -> 6148 bytes 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .DS_Store create mode 100644 HHRouterExample/.DS_Store create mode 100644 HHRouterExample/Images.xcassets/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..85eb1eae539d2545d111d899c00a7afcc1a71e24 GIT binary patch literal 6148 zcmeHK!AiqG5Pe%KR6N+D-u4TG{(yv%f@k{!N>VD4bVF&xV?MFqXZRDo*;z_U)I$+b znJF`GGntuW--g`|05@&R2`~mQq6!YqXg(0RFWQqq@|+S~tkGhF1=g71r5A0E-^hTh z-34y>yFecW55{rGYrUXP8ppmnl%QD0b^jt zfb0*RDwrkg6yw%G6I%e{knSiPOD`cgK4F%yQ{)|r(^R6Sy3}GgO{d?dxGZ6(sOfO2 z`EcpUE_Em_KArV_42R1U%^Cy7z##)CdO4Q!fA)F*f0$%f#(**KuNZK{e4bA^rF6FT wCMRdDr`}UVB(783rEn0BV#dl*d`XQ$zn1|qOV}yWL$N;skp?ryz>hNU4$W3kX8-^I literal 0 HcmV?d00001 diff --git a/HHRouter/HHRouter.m b/HHRouter/HHRouter.m index 60e7e5b..d188680 100644 --- a/HHRouter/HHRouter.m +++ b/HHRouter/HHRouter.m @@ -108,7 +108,7 @@ - (NSDictionary *)paramsInRoute:(NSString *)route params[@"route"] = [self stringFromFilterAppUrlScheme:route]; NSMutableDictionary *subRoutes = self.routes; - NSArray *pathComponents = [self pathComponentsFromRoute:[self stringFromFilterAppUrlScheme:route]]; + NSArray *pathComponents = [self pathComponentsFromRoute:params[@"route"]]; for (NSString *pathComponent in pathComponents) { BOOL found = NO; NSArray *subRoutesKeys = subRoutes.allKeys; @@ -174,7 +174,7 @@ - (NSMutableDictionary *)routes - (NSArray *)pathComponentsFromRoute:(NSString *)route { NSMutableArray *pathComponents = [NSMutableArray array]; - for (NSString *pathComponent in route.pathComponents) { + for (NSString *pathComponent in [NSURL URLWithString:route].path.pathComponents) { if ([pathComponent isEqualToString:@"/"]) continue; if ([[pathComponent substringToIndex:1] isEqualToString:@"?"]) break; [pathComponents addObject:pathComponent]; diff --git a/HHRouterExample/.DS_Store b/HHRouterExample/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4058a4c0c68eb6a0b841e6735a8bef2b7a9cbbed GIT binary patch literal 6148 zcmeH~Jx;?w5QX1D3QH78Nx3IL;s#a}3TiF@BoPt{7-1q&y5ris`3Z95&{Ci`*6j0+ zXLjYU@OS}~<$iMwEC4igQ+(MlHG6J8v9pYr7GL8H@96Nn>DRkS_UVAtHrV17SJ+`x z|JZfD#vHeJ!2_O{)HCT5YtDLJTYR9mtq!TDcTiLWL_h>YKm-W|Wq>?6pLLrVd>(%$&S zJ9qXJULOEi?l;%K48WABh)*5Hq4zaMaTbiC*cvrjykmh!bffCiglgxwVSR^N4D}th zG2h`CADdm>Jhg43%Ut4)TkN@2jaSOvID28y0?mNm9{8d3^iw384x|I=Kst~P{2vF{ zvo)p{jya|S=|DR0?SOtC3RAHP>>cgX!NHCI#0hB&UfWrMSd<`EfxROchPagIQi&sm zxSV{6x+<`DbUDO!<~p&n#0f=gck;!`A(dl}=|DPg?7+ECXWIYQ%pcDG$D*921L?q@ zazG}l`_+=K6uouya@uPP^MQE?)>=6SYsExs#hhp>z8cgOz2^NYuy-^$d6N_KM?iha JNC$qyfiK)mBh>%^ literal 0 HcmV?d00001