Re: Objective-C basics - (Why NSNumber conforms to NSCopying protocol)

2016-08-10 Thread David Duncan
> On Aug 10, 2016, at 11:32 PM, Sasikumar JP wrote: > > Hi, > > This may be very basic question. I am curious to know the details. > > what was the reason NSNumber conforms to NSCopying protocol. > > NSNumber is immutable class, Making a copy of NSNumber object returns the > same reference.

Objective-C basics - (Why NSNumber conforms to NSCopying protocol)

2016-08-10 Thread Sasikumar JP
Hi, This may be very basic question. I am curious to know the details. what was the reason NSNumber conforms to NSCopying protocol. NSNumber is immutable class, Making a copy of NSNumber object returns the same reference. Is there any case where NSNumber returns the new object? if not, then

Re: NSImage drawInRect deadlock

2016-08-10 Thread Doug Hill
> On Aug 10, 2016, at 4:49 PM, Graham Cox wrote: > > >> On 9 Aug 2016, at 4:05 AM, Andrew Keller wrote: >> >> In my app, I’m creating thumbnails of images. To do this in parallel, I’m >> using the global background dispatch queue: > > > Just to throw another consideration into the discusi

Re: NSImage drawInRect deadlock

2016-08-10 Thread Graham Cox
> On 9 Aug 2016, at 4:05 AM, Andrew Keller wrote: > > In my app, I’m creating thumbnails of images. To do this in parallel, I’m > using the global background dispatch queue: Just to throw another consideration into the discusion, you don’t say what the thumbnails are being used for. Typica

Re: Dynamic-width Collection View

2016-08-10 Thread Peter Tomaselli
I definitely remember feeling like there was a bit of a mismatch between the “declarative” feel of auto layout and the more procedural feel of all the necessary collection view layout overrides and whatnot. Bridging that gap was the main reason for all the shenanigans in that code (well, that an

Re: Dynamic-width Collection View

2016-08-10 Thread Doug Hill
Peter, I really appreciate your feedback and did look at your solution last week. I kind of gave up on the justification issue since it looks like what I saw is "expected" behavior and didn't want to get into workarounds until I figured out the self-sizing cells issue. I looked at your code an

Re: Dynamic-width Collection View

2016-08-10 Thread Doug Hill
On Aug 10, 2016, at 3:18 PM, Jonathan Hull wrote: > > The main issue is that the cell doesn’t (and shouldn’t) have any idea about > what size the collectionView is. You could actually use the delegate though > (which has a wider view) and provide the size that way. Agreed that the cell should

Re: Dynamic-width Collection View

2016-08-10 Thread Peter Tomaselli
Sorry if this is kind of a cheesy reply, but a while ago I believe we were speaking about “left-justifying” a collection view as well? I think I replied to that thread with a link to a very unattractive toy repo of mine on GitHub to illustrate the approach I’d taken with that. Anyway that repo doe

Re: Dynamic-width Collection View

2016-08-10 Thread Jonathan Hull
The main issue is that the cell doesn’t (and shouldn’t) have any idea about what size the collectionView is. You could actually use the delegate though (which has a wider view) and provide the size that way. That said, I did additional research and found other people with your issue. Relevant

Re: Dynamic-width Collection View

2016-08-10 Thread Doug Hill
Jonathon, Thanks for the feedback. A question that comes to mind is, what about making cells the same size as the collection view requires going through subclassing the collection view layout? Apple documentation IMPLIES this should work. It even documents that developers should use preferredL

Re: Dynamic-width Collection View

2016-08-10 Thread Doug Hill
> On Aug 10, 2016, at 2:03 PM, Quincey Morris > wrote: > > On Aug 10, 2016, at 13:42 , Doug Hill > wrote: >> >> this basically means that Apple's documentation is a fail and the APIs don't >> work in a predictable way. Again, this should also be noted so other >>

Re: Dynamic-width Collection View

2016-08-10 Thread Quincey Morris
On Aug 10, 2016, at 13:42 , Doug Hill wrote: > > this basically means that Apple's documentation is a fail and the APIs don't > work in a predictable way. Again, this should also be noted so other > developers don't go through all the trouble I've done to implement very basic > functionality.

Re: Cocoa File Close Notification

2016-08-10 Thread Sandor Szatmari
Have you considered using a dispatch source? You might have to do some manual checking when you get a notification about activity with your file, but it might be suitable to your needs. Here's a link I was reading: http://stackoverflow.com/questions/11355144/file-monitoring-using-grand-central-

Re: Dynamic-width Collection View

2016-08-10 Thread Doug Hill
> On Aug 10, 2016, at 1:35 PM, Quincey Morris > wrote: > > On Aug 10, 2016, at 13:29 , Doug Hill > wrote: >> >> Again, looking for any ideas, pointers, etc. about any of this, including >> whether I'm going about this the wrong way. > > This is something that you

Re: Dynamic-width Collection View

2016-08-10 Thread Nicolas Kozic
performa 640 pizza live > On Aug 10, 2016, at 10:29 PM, Doug Hill wrote: > > >> On Aug 10, 2016, at 11:10 AM, Doug Hill wrote: >> >> I'm currently trying to implement something that seems basic but has been >> driving me nuts: making a Collection View with cells that are dynamic-width >> and

Re: Dynamic-width Collection View

2016-08-10 Thread Quincey Morris
On Aug 10, 2016, at 13:29 , Doug Hill wrote: > > Again, looking for any ideas, pointers, etc. about any of this, including > whether I'm going about this the wrong way. This is something that you should use a TSI for. Because collection views have evolved over OS generations, it’s now hard to

Re: Dynamic-width Collection View

2016-08-10 Thread Doug Hill
> On Aug 10, 2016, at 11:10 AM, Doug Hill wrote: > > I'm currently trying to implement something that seems basic but has been > driving me nuts: making a Collection View with cells that are dynamic-width > and height at runtime. > > I was able to accomplish this with Table Views by using the

Re: Cocoa File Close Notification

2016-08-10 Thread Jens Alfke
> On Aug 10, 2016, at 12:10 PM, Gurkan Erdogdu wrote: > > I try to get file close notification in Cocoa/Swift. Is there any way to do > this? I tried to use FSEvent API but this does not provide any notification > for file close events. I don’t think there’s any such notification. File handle

Dynamic-width Collection View

2016-08-10 Thread Doug Hill
I'm currently trying to implement something that seems basic but has been driving me nuts: making a Collection View with cells that are dynamic-width and height at runtime. I was able to accomplish this with Table Views by using the dynamic height constant. Following Apple documentation, I set

Re: NSImage drawInRect deadlock

2016-08-10 Thread Andrew Keller
Am 10.08.2016 um 2:48 vorm. schrieb Quincey Morris : > On Aug 9, 2016, at 20:47 , Andrew Keller > wrote: >> >> 2. When utilizing Mike’s approach to limiting the number of parallel tasks >> down to, say, 1-8, I have been completely unable to reproduce the deadlock.