If you're not multithreading, i.e. starting a method that runs on a separate thread from loadMainViewImages
, then the methods will be executed sequentially. So once the loadMainViewImages
returns you can be sure everything "in it" was executed. This is how methods work.
EDIT for better formatting of the comments:
MainViewDownload.h
@protocol MainViewDownloadDelegate;
@interface MainViewDownload
@property (nonatomic, weak) NSObject<MainViewDownloadDelegate> *delegate;
@end
@protocol MainViewDownloadDelegate
- (void)downloadDidFinish:(MainViewDownload *)download;
@end
MainViewDownload.m
@implementation MainViewDownload
- (void)someMethodThatDownloadsStuff_OrIsCalledAfterTheDownload {
...
if ([self.delegate respondsToSelector:@selector(downloadDidFinish:)]) {
[self.delegate downloadDidFinish:self];
}
}
@end
RootViewController.h
@interface RootViewController <MainViewDownloadDelegate>
...
@end
RootViewController.m
@implementation
...
- (void)downloadDidFinish:(MainViewDownload *)download {
// hide the download view here.
}
@end
Make sure to set the delegate of the download view to the root view controller.