The FBRequestConnectionDelegate
protocol defines the methods used to receive network
activity progress information from a FBRequestConnection.
Extends Protocol: | NSObject |
Declared in: | FBRequestConnection.h |
requestConnection:didFailWithError:
Tells the delegate the request connection failed with an error
Parametro | Descrizione |
---|---|
connection | The request connection that successfully completed a network request |
error | The |
- (void)
requestConnection: | (FBRequestConnection *)connection |
didFailWithError: | (NSError *)error; |
If the request connection fails with a network error then this method is called. The error
argument specifies why the network connection failed. The NSError
object passed to the
FBRequestHandler block may contain additional information.
This method is invoked after the completion handler for each FBRequest and only if a network request was made. If the request was fulfilled using cached data, this method is not called.
FBRequestConnection.h
requestConnection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:
Tells the delegate how much data has been sent and is planned to send to the remote host
Parametro | Descrizione |
---|---|
connection | The request connection transmitting data to a remote host |
bytesWritten | The number of bytes sent in the last transmission |
totalBytesWritten | The total number of bytes sent to the remote host |
totalBytesExpectedToWrite | The total number of bytes expected to send to the remote host |
- (void)
requestConnection: | (FBRequestConnection *)connection |
didSendBodyData: | (NSInteger)bytesWritten |
totalBytesWritten: | (NSInteger)totalBytesWritten |
totalBytesExpectedToWrite: | (NSInteger)totalBytesExpectedToWrite; |
FBRequestConnection.h
requestConnection:willRetryWithRequestConnection:
Tells the delegate the request connection is going to retry some network operations
Parametro | Descrizione |
---|---|
connection | The request connection that successfully completed a network request |
retryConnection | The new request connection that will retry the failed s |
- (void)
requestConnection: | (FBRequestConnection *)connection |
willRetryWithRequestConnection: | (FBRequestConnection *)retryConnection; |
If some FBRequests
fail, FBRequestConnection may create a new instance to retry the failed
requests. This method is called before the new instance is started. You must set the delegate
property on retryConnection
to continue to receive progress information. If a delegate is
set on retryConnection
then -requestConnectionWillBeginLoading: will be invoked.
This method is invoked after the completion handler for each FBRequest and only if a network request was made. If the request was fulfilled using cached data, this method is not called.
FBRequestConnection.h
requestConnectionDidFinishLoading:fromCache:
Tells the delegate the request connection finished loading
Parametro | Descrizione |
---|---|
connection | The request connection that successfully completed a network request |
isCached | YES if the request was fulfilled using cached data, otherwise NO indicating a network request was completed. |
- (void)
requestConnectionDidFinishLoading: | (FBRequestConnection *)connection |
fromCache: | (BOOL)isCached; |
If the request connection completes without a network error occuring then this method is called. Invocation of this method does not indicate success of every FBRequest made, only that the request connection has no further activity. Use the error argument passed to the FBRequestHandler block to determine success or failure of each FBRequest.
This method is invoked after the completion handler for each FBRequest.
FBRequestConnection.h
requestConnectionWillBeginLoading:fromCache:
Tells the delegate the request connection will begin loading
Parametro | Descrizione |
---|---|
connection | The request connection that is starting a network request |
isCached | YES if the request can be fulfilled using cached data, otherwise NO indicating the result will require a network request. |
- (void)
requestConnectionWillBeginLoading: | (FBRequestConnection *)connection |
fromCache: | (BOOL)isCached; |
If the FBRequestConnection is created using one of the convenience factory methods prefixed with start, the object returned from the convenience method has already begun loading and this method will not be called when the delegate is set.
FBRequestConnection.h