In Erica Sadun’s Download Helper, link here, I can put these methods into my classes:
- (void) didReceiveData: (NSData *) theData;
- (void) didReceiveFilename: (NSString *) aName;
- (void) dataDownloadFailed: (NSString *) reason;
- (void) dataDownloadAtPercent: (NSNumber *) aPercent;
these methods obviously refer back to the “DownloadHelper.h” and “DownloadherHelper.m”. I want to know if I am able to access properties on the xib view such as textfields, uitableviews, uilabels … etc in one of these methods. For example:
- (void) didReceiveFilename: (NSString *) aName {
[label setText:@"hi"];
}
I have tried doing so, but the objects on the xib view won’t update. like the given example above. Is there any way to do this?
Thanks,
Kevin
It should be possible to access/update the properties of any outlets that you have linked from your xib into your controller. Have you verified via the debugger that the
didReceiveFilename:message is being sent to your controller, and thatlabelis non-nil when thesetText:message is sent to it?Edit: I communicated with the person that posted this question offline. The problem was not related to the asynchronous downloads. His code was attempting to notify the controller of the view that contained the table view that a download had started, but the message was sent to the wrong controller instance. Fixing this corrected the problem.
Changed from this:
To this:
The
downloadstartmethod is responsible for updating the table view in Kevin’s code.