Problem Ejecting Discs
Problem Ejecting Discs
- Subject: Problem Ejecting Discs
- From: Patrick Machielse <email@hidden>
- Date: Fri, 21 Nov 2003 11:11:59 +0100
I have an NSImageView displaying a pdf located on a mounted CD. When I try
to eject the CD using:
[myImageView setImage:nil];
[[NSWorkspace sharedWorkspace] unmountAndEjectDeviceAtPath:@"myPath"];
It fails. Somehow the ImageView keeps the pdf file open on the device,
preventing a successful eject.
In 'lab' conditions, I replaced the NSImageView with a subclass of NSView
which draws an NSImage (home made NSImageView). Now the above code _does_
work. Sadly, in my 'real world' program I couldn't replicate this result.
Someone must have struggled with this before. Please help! Is there some
known 'art' of ejecting removable discs? Can I check beforehand if the
NS(Image)View has a pointer to a file on disc? And what to do if it has?
Patrick Machielse
Hieper.nl
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.