NSNotificationCenter and ASIHTTPRequest
Posted
by user262325
on Stack Overflow
See other posts from Stack Overflow
or by user262325
Published on 2010-05-15T05:52:32Z
Indexed on
2010/05/15
6:04 UTC
Read the original article
Hit count: 402
iphone
Hello everyone:
I hope to get the http header info(file size) in asynchronous mode.
So I initialize as codes:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(processReadResponseHeaders:) name:@"readResponseHeaders"
object:nil];
my codes to read the http header
-(void)processReadResponseHeaders: (ASIHTTPRequest *)request ;//(id)sender;
{
unsigned long long contentLength = [request contentLength]; //error occurs here
}
It has to change the source code of ASIHTTPRequest.m
I did add my codes in function readResponseHeaders to notify the event is triggered )
- (void)readResponseHeaders
{
//.........................
[[NSNotificationCenter defaultCenter] postNotificationName:@"readResponseHeaders" object:self];//
}
the log file reports:
2010-05-15 13:47:38.034 myapp[2187:6a63] * -[NSConcreteNotification contentLength]: unrecognized selector sent to instance 0x46e5bb0
Welcome any comment
Thanks interdev
© Stack Overflow or respective owner