• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem Ejecting Discs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Problem Ejecting Discs
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Finding memory leaks and memory bugs (was Re: [OT] Re: Don't leak memory!!)
  • Next by Date: Re: Limit NSTextField Size of Input
  • Previous by thread: Re: [OT] ssh tunnels and port < 1024 (NSTask)
  • Next by thread: Re: Problem Ejecting Discs
  • Index(es):
    • Date
    • Thread