Hi everybody
I have this simple scenario:
- main.m (which is my main class)
- myClass.m (which is an additional class)
In my plans it should happen something like this
(in MAIN.m)
myClass *foo = [[myClass alloc] init];
NSArray *array = [foo returnAnArray];
What myClass does is opening a new NSURLConnection, retrieving some data and - when it's ready - parsing it and returning an array.
To return an array with the parsed data I wrote this simple
(NSArray *) returnArray:(NSString *)dataDownloadedFromWeb
In order to know when the data has ACTUALLY finished downloading and when to start parsing it, I'm using
- (void) connectionDidFinishDownloading: (NSURLConnection *connection)
But WHERE and HOW can I call returnArray: if connectionDidFinishLoading is VOID? :(
I hope this makes sense... I'm really stuck and I cannot seem to find a solution. I tried with NSNotification but it didn't seem to work either.
Thanks everybody for the support! Enrico