recycleURLs doesn't enable Put Back or Undo in Finder

2015-01-18 Thread Steve Mills
Is there any way to ensure that NSWorkspace recycleURLs:completionHandler: will let the user go to the Finder and Put Back or Undo? I'm very surprised that it doesn't work right. Not even NSFileManager's trashItemAtURL:resultingItemURL:error: does that. I'm trying it in 10.10. -- Steve Mills Dr

Re: CVPixelBuffer and Color profiles

2015-01-18 Thread Quincey Morris
On Jan 18, 2015, at 17:22 , Kevin Meaney wrote: > > How can I make sure that the CGBitmapContext and CVPixelBuffer view the pixel > data in the same way from a color matching perspective? You can attach a color space to the pixel buffer as follows: CVBufferSetAttachment (pixelBuffer, k

CVPixelBuffer and Color profiles

2015-01-18 Thread Kevin Meaney
I would like to have a CVPixelBuffer function that returns the color profile of a CVPixelBuffer. I'm using the CVPixelBuffer data as a backing store when I create a CGBitmapContext and I would like to provide the appropriate color profile when I create the CGBitmapContext. The CVPixelBuffer is c

Re: Fast Enumeration and remove elements

2015-01-18 Thread Quincey Morris
On Jan 18, 2015, at 12:45 , Trygve Inda wrote: > > NSMutableDictionary* collection; // keys are myID, values are MyObject > > for (MyObject* object in [[self collection] allValues]) > { >[collection removeObjectForKey:[object myID]]; > } What Ken said, plus … — If the collection of values

Re: Fast Enumeration and remove elements

2015-01-18 Thread Ken Thomases
On Jan 18, 2015, at 2:45 PM, Trygve Inda wrote: > So is this safe... > > NSMutableDictionary* collection; // keys are myID, values are MyObject > > for (MyObject* object in [[self collection] allValues]) > { >[collection removeObjectForKey:[object myID]]; > } > > It would seem that this i

Fast Enumeration and remove elements

2015-01-18 Thread Trygve Inda
Apple says: > It is not safe to remove, replace, or add to a mutable collection’s elements > while enumerating through it. If you need to modify a collection during > enumeration, you can either make a copy of the collection and enumerate using > the copy or collect the information you require dur

Re: Testing selection with NSArrayController?

2015-01-18 Thread Rick Mann
> On Jan 18, 2015, at 00:26 , Quincey Morris > wrote: > > On Jan 18, 2015, at 00:10 , Rick Mann wrote: >> >> I'm building a view that renders a bunch of objects (a drawing canvas). Some >> of these render differently if the objects are selected. As I iterate >> through the list of objects t

Re: Testing selection with NSArrayController?

2015-01-18 Thread Quincey Morris
On Jan 18, 2015, at 00:10 , Rick Mann wrote: > > I'm building a view that renders a bunch of objects (a drawing canvas). Some > of these render differently if the objects are selected. As I iterate through > the list of objects to render, I need to test if each one is selected. It would be eas

Testing selection with NSArrayController?

2015-01-18 Thread Rick Mann
I don't see any method for testing if an object is selected, other than to first get the index of the object in the backing NSArray, then see if that index is in the NSArrayController's selectedIndexes. Is this really the way to test to see if an object is selected? I'm building a view that ren