objective c - NSImage size problem -


i'm using same image resource in 2 different controllers. in both controllers image shown in different sizes, problem once image shown in smaller size original, next time image [nsimage imagenamed:@"resource.png"] image size set last size took. tried invoking recache method on nsimage , tried set cache mode posible value, didn't work.

any ideas?

the thing that

[nsimage imagenamed] 

as mentioned in cache, , long in cache return cached image need first released previous reference or use object's setname method , setting nil. here documentation reference:

the nsimage class may cache reference returned image object performance in cases. however, class holds onto cached objects while object exists. if image object subsequently released, either because retain count 0 or not referenced anywhere in garbage-collected application, object may quietly removed cache. thus, if plan hold onto returned image object, must retain cocoa object. you can clear image object cache explicitly calling object’s setname: method , passing nil image name.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -