首页 > Web开发 > 详细

NSURLProtocol

时间:2017-07-18 23:58:37      阅读:298      评论:0      收藏:0      [点我收藏+]

@abstract This method registers a protocol class, making it visible

    to several other NSURLProtocol class methods.

    @discussion When the URL loading system begins to load a request,

    each protocol class that has been registered is consulted in turn to

    see if it can be initialized with a given request. The first

    protocol handler class to provide a YES answer to

    <tt>+canInitWithRequest:</tt> "wins" and that protocol

    implementation is used to perform the URL load. There is no

    guarantee that all registered protocol classes will be consulted.

    Hence, it should be noted that registering a class places it first

    on the list of classes that will be consulted in calls to

    <tt>+canInitWithRequest:</tt>, moving it in front of all classes

    that had been registered previously.

    <p>A similar design governs the process to create the canonical form

    of a request with the <tt>+canonicalRequestForRequest:</tt> class

    method.

    @param protocolClass the class to register.

    @result YES if the protocol was registered successfully, NO if not.

    The only way that failure can occur is if the given class is not a

    subclass of NSURLProtocol.

NSURLProtocol

原文:http://www.cnblogs.com/feng9exe/p/7203436.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!