好的,所以在升级到 0.20.xi 之前,我的课程是这样路由的
[[RKObjectManager sharedManager].router routeClass:[Player class] toResourcePath:@"/player" forMethod:RKRequestMethodGET];
[[RKObjectManager sharedManager].router routeClass:[Player class] toResourcePath:@"/player" forMethod:RKRequestMethodPOST];
[[RKObjectManager sharedManager].router routeClass:[Player class] toResourcePath:@"/player" forMethod:RKRequestMethodPUT];
[[RKObjectManager sharedManager].router routeClass:[Player class] toResourcePath:@"/players" forMethod:RKRequestMethodDELETE];
[[RKObjectManager sharedManager].router routeClass:[WTFGameInfo class] toResourcePath:@"/game"forMethod:RKRequestMethodGET];
[[RKObjectManager sharedManager].router routeClass:[WTFGameInfo class] toResourcePath:@"/game" forMethod:RKRequestMethodPOST];
[[RKObjectManager sharedManager].router routeClass:[WTFGameInfo class] toResourcePath:@"/game/:gameID" forMethod:RKRequestMethodPUT];
[[RKObjectManager sharedManager].router routeClass:[WTFGameInfo class] toResourcePath:@"/games" forMethod:RKRequestMethodDELETE];
但是,使用 PathPatterns 已经发生了如此细微的变化,我想知道我是否可以将资源路径中的字符串完全一样,或者我必须将其更改为看起来像这样。
[[RKObjectManager sharedManager].router.routeSet addRoute:[RKRoute routeWithClass:[Player class] pathPattern:@"/player/:_id" method:RKRequestMethodGET]];//posibly do it for _fbID;
[[RKObjectManager sharedManager].router.routeSet addRoute:[RKRoute routeWithClass:[Player class] pathPattern:@"/player/:_id" method:RKRequestMethodPOST]];//posibly do it for _fbID;
[[RKObjectManager sharedManager].router.routeSet addRoute:[RKRoute routeWithClass:[Player class] pathPattern:@"/player/:_id" method:RKRequestMethodPUT]];//posibly do it for _fbID;
[[RKObjectManager sharedManager].router.routeSet addRoute:[RKRoute routeWithClass:[WTFGameInfo class] pathPattern:@"/game/:_id" method:RKRequestMethodGET]];//posibly do it for @"/game/:gameID";
[[RKObjectManager sharedManager].router.routeSet addRoute:[RKRoute routeWithClass:[WTFGameInfo class] pathPattern:@"/game/:_id" method:RKRequestMethodPOST]];//posibly do it for @"/game/:gameID";
[[RKObjectManager sharedManager].router.routeSet addRoute:[RKRoute routeWithClass:[WTFGameInfo class] pathPattern:@"/game/:_id" method:RKRequestMethodPUT]];//posibly do it for @"/game/:gameID";
谁能为我澄清一下?谢谢...