Hi all I don't understand retain
so well.
There is this code here:
mAppIcon = [[NSImage imageNamed:@"NSApplicationIcon"] retain];
I am trying to swizzle it so whenever they ask for image with name NSApplicationIcon
I give it my custom icon. I still see the original icon come back sometimes. I think it's because of this retain thing? Am I right? is it possible to clear the retain? This will make my swizzle works 100% of time instead of only 80% as it does now :(
I read here about retain
but I wasnt able to apply it to help my situation above: http://www.cocoawithlove.com/2010/06/assign-retain-copy-pitfalls-in-obj-c.html
Very specifically I am trying to swizzle this here: https://dxr.mozilla.org/mozilla-central/source/widget/cocoa/nsMacDockSupport.mm?offset=200#140