I'm writing a little static library (lib.a) for the iphone and I'm using ASIHTTPRequest to manage my data posting and etc.
I have the main implementation (@implementation BlaBla) but in the main .m file, I have another (@interface Foo) and (@implementation Foo) for private methods.
I've implemented the ASIHTTPRequestDelegate in the (@interface Foo) but the - (void)requestFinished:(ASIHTTPRequest *)request, but this method doesn't executing!
No matter what I did, it doesn't work. I've added NSLog to log the requestFinished method, but it's not working.
Example code:
@interface ActionsManager : NSObject <ASIHTTPRequestDelegate>
+ (void)blabla;
@end
@implementation ActionsManager
+ (void)blabla{
NSURL *requestUrl = [NSURL URLWithString:[NSString stringWithFormat:@"Bla.com/bla"]];
BlaRequest = [[[ASIFormDataRequest alloc] initWithURL:requestUrl]autorelease];
self = [BlaRequest delegate];
[BlaRequest setPostValue:blabla forKey:@"bla"];
[BlaRequest setRequestMethod:@"POST"];
[BlaRequest startAsynchronous];
}
- (void)requestFinished:(ASIHTTPRequest *)request{
NSLog(@"request finished");
}
- (void)requestStarted:(ASIHTTPRequest *)request{
NSLog(@"request started");
}
@end
@implementation MainImplementation
- (id)init
{
self = [super init];
if (self) {
}
return self;
}
+ (void)bbb{
[ActionsManager blabla];
}
@end
I'll be very thankful for any help!
BTW, can it be because of instance methods (-) or class methods (+)?