I am trying to override
- (void)makeWindowControllers;
Here is the code for it:
NSStoryboard* const storyboard = [NSStoryboard storyboardWithName:@"Main" bundle:nil];
NSWindowController* const windowController = [storyboard instantiateControllerWithIdentifier:@"Document Window Controller"];
And then I would like to add an image to ViewController that user has selected through open... in Swift I would simply do:
(windowController.contentViewController as? ViewController)?.imageView?.image = openedImage
How I could do this downcasting in Objective-C? I really got confused since I haven't done much type converting while I was learning C. Thanks.
[[((ViewController *)[windowController contentViewController]) imageView] setImage: openedImage];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With