Hey I have been battling with this problem for a while now. Perhaps there is something I am missing in knowledge about multi threading but here is what happens. When I create an nsoperation queue any variables that are allocated become cleared after the "[request startSynchronous];" line of code. Here is what I'm talking about:
@implementation imageLoadOperation
@synthesize object;
-(id)initWithObject:(NSMutableArray *)receivedObject
{
...
object = receivedObject;
...
}
- (void)main {
...
//send request
printf("retreiving photo info from server\n");
NSURL *url = [NSURL URLWithString:[siteUrl stringByAppendingString:@"/connect.php"]];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setPostValue:@"lookAtPhoto" forKey:@"purpose"];
[request setRequestCookies: [ASIHTTPRequest sessionCookies]];
The object still exists here
[request startSynchronous];
Then the object disappears here!
I'm sure this has something to do with a gap in principle understanding but I have been rearranging the code for days now to no success.
...