Re: split views, best practices for 10.8?

2012-12-08 Thread Kyle Sluder
On Sat, Dec 8, 2012, at 04:19 PM, Chuck Soper wrote: > On 11/27/12 6:33 PM, "Chuck Soper" wrote: > >On 11/27/12 2:11 PM, "Peter Ammon" wrote: > > > >>Hi Chuck, > >> > >>Autolayout works well with NSSplitView in 10.8. > > > >Perfect. Thanks for that confirmation. > > Does that mean that in 10.8 (

Re: How to implement readonly property

2012-12-08 Thread Kyle Sluder
On Sat, Dec 8, 2012, at 05:27 PM, Richard Heard wrote: > Greg, > > So, from what you are saying, either of these snippets should be valid, > right? > > > +(id)sharedInstance{ > > static id _sharedInstance = nil; > > > > if (!_sharedInstance){ > > @synchronized([self class]){ > >

Re: How to implement readonly property

2012-12-08 Thread Rick Mann
On Dec 8, 2012, at 18:51 , Greg Parker wrote: > Use dispatch_once(). It is shorter, simpler, and more obviously correct. The > memory barrier implementation may also be correct, but why take the risk? What about for similar non-static properties? -- Rick _

Re: How to implement readonly property

2012-12-08 Thread Greg Parker
On Dec 8, 2012, at 5:27 PM, Richard Heard wrote: > Greg, > > So, from what you are saying, either of these snippets should be valid, right? > >> +(id)sharedInstance{ >> static id _sharedInstance = nil; >> >> if (!_sharedInstance){ >> @synchronized([self class]){ >>

Re: How to implement readonly property

2012-12-08 Thread Richard Heard
Greg, So, from what you are saying, either of these snippets should be valid, right? > +(id)sharedInstance{ > static id _sharedInstance = nil; > > if (!_sharedInstance){ > @synchronized([self class]){ > if (!_sharedInstance){ > id sharedInstance = [[s

Re: How to implement readonly property

2012-12-08 Thread Greg Parker
On Dec 8, 2012, at 11:17 AM, Steve Sisak wrote: > At 10:24 AM -0800 12/8/12, Kyle Sluder wrote: >> On Dec 8, 2012, at 10:06 AM, Steve Sisak wrote: >> >>> Further, if writes were not complete at the end of the block, the construct >>> would besentially useless for its intended purpose. >> >> By

Re: split views, best practices for 10.8?

2012-12-08 Thread Chuck Soper
Hi Peter, On 11/27/12 6:33 PM, "Chuck Soper" wrote: >On 11/27/12 2:11 PM, "Peter Ammon" wrote: > >>Hi Chuck, >> >>Autolayout works well with NSSplitView in 10.8. > >Perfect. Thanks for that confirmation. Does that mean that in 10.8 (and not 10.7) that it's fine to call setTranslatesAutoresizing

Re: How to implement readonly property

2012-12-08 Thread Jean Suisse
Speaking of Double-Checked Locking, there is this interesting article from Scott Meyers and Andrei Alexandrescu, written in 2004, which states: This article explains why Singleton isn’t thread safe, how DCLP attempts to address that problem, why DCLP may fail on both uni- and multiprocessor ar-

Re: How to implement readonly property

2012-12-08 Thread Ken Thomases
On Dec 8, 2012, at 1:17 PM, Steve Sisak wrote: > At 10:24 AM -0800 12/8/12, Kyle Sluder wrote: >> On Dec 8, 2012, at 10:06 AM, Steve Sisak wrote: >> >> > Further, if writes were not complete at the end of the block, the >> > construct would be essentially useless for its intended purpose. >> >

Re: How to implement readonly property

2012-12-08 Thread Steve Sisak
At 10:24 AM -0800 12/8/12, Kyle Sluder wrote: On Dec 8, 2012, at 10:06 AM, Steve Sisak wrote: > Further, if writes were not complete at the end of the block, the construct would be essentially useless for its intended purpose. By the way, you're wrong about this too. All @synchronized does

Re: How to implement readonly property

2012-12-08 Thread Kyle Sluder
On Dec 8, 2012, at 10:06 AM, Steve Sisak wrote: > > Further, if writes were not complete at the end of the block, the construct > would be essentially useless for its intended purpose. By the way, you're wrong about this too. All @synchronized does is act as a mutex around a code block. It do

Re: How to implement readonly property

2012-12-08 Thread Kyle Sluder
On Dec 8, 2012, at 10:06 AM, Steve Sisak wrote: > At 8:35 AM -0800 12/8/12, Kyle Sluder wrote: >> On Dec 7, 2012, at 8:38 PM, Marco S Hyman wrote: >> >>> On Dec 7, 2012, at 8:18 PM, Steve Sisak wrote: >>> I'm interested if there are an any issued I'm missing in the Obj-C, @synchron

Re: How to implement readonly property

2012-12-08 Thread Steve Sisak
At 8:35 AM -0800 12/8/12, Kyle Sluder wrote: On Dec 7, 2012, at 8:38 PM, Marco S Hyman wrote: On Dec 7, 2012, at 8:18 PM, Steve Sisak wrote: I'm interested if there are an any issued I'm missing in the Obj-C, @synchronized(self), instance variable case. Your pattern can fail if this l

Re: delaying document close

2012-12-08 Thread Kyle Sluder
On Dec 7, 2012, at 11:28 PM, Martin Hewitson wrote: > > But I still get occasional crashes so I was wondering if there is a way to > delay the closing of the document by one or two seconds to allow all the > background processes which may be executing to finish before pulling the rug > out fr

Re: Layers in NSCollectionView (solved)

2012-12-08 Thread Gordon Apple
Some things turn out to be simple, if you know where to look. I¹m posting this in case anyone else runs into this issue. Unfortunately, the Collection View Guide does not mention it. The solution is to subclass NSCollectionView and override newItemForRepresentedObject. It gives you the represen

Re: How to implement readonly property

2012-12-08 Thread Kyle Sluder
On Dec 7, 2012, at 8:38 PM, Marco S Hyman wrote: > On Dec 7, 2012, at 8:18 PM, Steve Sisak wrote: > >> I'm interested if there are an any issued I'm missing in the Obj-C, >> @synchronized(self), instance variable case. > > > Your pattern can fail if this line >_someDictionary = temp;

PDFKit two page display differs from Preview

2012-12-08 Thread Martin Hewitson
Dear list, When one uses PDFKit and PDFView to display a pdf, there are built-in view settings one can access (right-click context menu) for setting "Two Pages", "Two Page Continuous" etc. On Preview.app, you only get View->Single Page or View->Two Pages. The issue I have is that given a PDF c