2016-08-15 21 views
0

システムAPIを使用してこのジョブをすばやく実行できますか? regexまたはpathqueryを手動で使用することができます。 私はNSURLComponentsを知っていますが、絶対URLを相対URLに変更できますか?絶対URLを相対URL使用システムAPIに変更すると、すばやくクリーンアップできますか?

私はちょうど興味があります、私たちはこれを迅速かつきれいに行うシステムAPIを使用できますか?

+0

はhttps://developer.apple.com/library/ios/documentation/Foundation/Reference/NSURLComponents_class/を見てください – ogres

答えて

1

現在、私は次のスニペットを使用します。

NSURL *url; 

NSURLComponents *urlComponents = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO]; 
urlComponents.scheme = nil; 
urlComponents.host = nil; 

NSURL *relativeURL = urlComponents.URL; 
関連する問題