NSNotificationCenter and ASIHTTPRequest
- by user262325
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