On Wed, Feb 13, 2013, at 12:54 PM, Nick Zitzmann wrote: > > On Feb 13, 2013, at 2:12 AM, norbert <ndoer...@cdfinder.de> wrote: > > > In Mac OS X 10.6.8, it works fine, and closes the image files after use. > > But in 10.8.2, it keeps every single one of them open. > > > > Here is the code I use: > > > > NSImage *nextImage = [NSImage > > imageNamed:@"Animator1.png"]; > > if (nextImage != NULL) > > [myImageView setImage:nextImage]; > > > > myImageView is a regular NSImageView. The app is non GC, and non ARC. > > > > Is that a new "feature" of Mountain Lion? > > Maybe. +imageNamed: does some caching behind the scenes, and this is > explained in the method's documentation. If you need image files to be > opened, read into memory, and then closed, then the first thing I would > try is initializing them from unmapped NSData objects created using > +dataWithContentsOfURL:options:error:.
Easier than that, you can just call -setCacheMode:NSImageCacheNever to disable caching. --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com