App crashing when adding to Open Recent menu

2011-12-08 Thread Rico
Hi, For one of my users my application is always crashing when it tries to add an entry to the "Open Recent" menu via: [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: [NSURL fileURLWithPath:folderPath]] He is running Mac OS X Lion Server 10.7.2. Full stack trace

Re: Locks

2011-12-08 Thread Andreas Grosam
On Dec 7, 2011, at 12:07 PM, Jean-Daniel Dupas wrote: > > Le 7 déc. 2011 à 06:10, Ken Thomases a écrit : > >> On Dec 6, 2011, at 10:05 PM, Don Quixote de la Mancha wrote: >> >> You still shouldn't implement it manually using atomic increment and >> decrement. You should use OSSpinLock if tha

Re: Locks

2011-12-08 Thread Jean-Daniel Dupas
Le 8 déc. 2011 à 09:57, Andreas Grosam a écrit : > > On Dec 7, 2011, at 12:07 PM, Jean-Daniel Dupas wrote: > >> >> Le 7 déc. 2011 à 06:10, Ken Thomases a écrit : >> >>> On Dec 6, 2011, at 10:05 PM, Don Quixote de la Mancha wrote: >>> >>> You still shouldn't implement it manually using atomic

Re: "byte orders" question

2011-12-08 Thread Sean McBride
On Sat, 26 Nov 2011 16:23:47 -0800, Kyle Sluder said: >> Since you're just doing a memcpy(), you can simply cast the bits and avoid >> the copying.  Try this: >> >> float f = *((float*) &res); >> >> Or try defining a C union: >> >> union foo {  float f;  u_int32_t u;  }; >> union foo bar; >> bar.u

Re: "byte orders" question

2011-12-08 Thread Scott Ribe
On Dec 8, 2011, at 8:45 AM, Sean McBride wrote: > The union strategy is dubious too, but in practice safer. It's neither illegal nor dubious. It's explicitly allowed. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice

NSIndexSet of NSButtonCells in NSOutlineView

2011-12-08 Thread Gilles Celli
Hi, I've the following problem: I'm writing an application which will display plots / graph: an NSOutlineView has been setup and working which displays the name, location of some scientific instruments (like thermometer, voltage etc.). The instrument's name is selectable as an NSButtonCell, the

Re: iOS: How to hide blue personal hotspot status bar?

2011-12-08 Thread Mike Abdullah
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/setStatusBarHidden:withAnimation: On 7 Dec 2011, at 23:40, Eagle Offshore wrote: > Angry Birds does it so it must be possible. So how can I do th

Re: ARC and dealloc

2011-12-08 Thread Matt Neuburg
On Wed, 07 Dec 2011 21:56:56 +0100, Mikkel Islay said: >Dear list, > >A question regarding the proper use of dealloc in ARC-environments (under iOS): >I have a need to unregister NSNotification observers during exchange of >UiViewControllers. Is implementing - (void)dealloc considered a proper u

Re: App crashing when adding to Open Recent menu

2011-12-08 Thread Jerry Krinock
I've not experienced this crash, but the call stack of your crash includes these lines. 4 com.apple.CoreFoundation CFURLCopyResourcePropertyForKey 5 com.apple.LaunchServices _LSGetIconRefForURL 6 com.apple.LaunchServices LSSharedFileListInsertItemURL The declaration of LSSharedFileListIns

Re: NSIndexSet of NSButtonCells in NSOutlineView

2011-12-08 Thread Quincey Morris
On Dec 8, 2011, at 08:12 , Gilles Celli wrote: > The instrument's name is selectable as an NSButtonCell, the idea is to turn > on/off its respective graph / plot. > So there's a mix of NSButtonCells along with NSString in the NSOutlineView. > My model's NSButtonCells are based of NSMutableDiction

Re: ARC and dealloc

2011-12-08 Thread Mikkel Islay
Thanks for the insightful reply, and of course to Jonny Yu and Scott Anguish as well. On 8 Dec 2011, at 17:36, Matt Neuburg wrote: >> You can certainly make assumptions about when dealloc is called - it is >> extremely deterministic, actually. See Greg Parker's discussion (in the WWDC >> 2011

Re: Locks

2011-12-08 Thread Sean McBride
On Tue, 6 Dec 2011 20:05:34 -0800, Don Quixote de la Mancha said: >It is a common misconception that the "volatile" keyword is necessary >or even helpful to code the implements locks and atomic operations. Indeed. A nice discussion of this is here:

Re: ARC and dealloc

2011-12-08 Thread Matt Neuburg
On Thu, 08 Dec 2011 20:31:51 +0100, Mikkel Islay said: >A twist on the tale, is that the observer wasn't the UIViewController, but a >helper object subclassed from NSObject. Hence view-unloading was one step >further removed from deallocation of the observer-instance. I have *never* added or

Re: NSIndexSet of NSButtonCells in NSOutlineView

2011-12-08 Thread Gilles Celli
Ok as you suggested it's better to call it active Buttons in the OutlineView then selected... For the NSIndexSet: let's say that I've 3 ore more NSButtonCells, if only one is active then it will display only one Graph, if it has 2 activated let's say the first and last one both resp. graphs wil

NSNetService getInputStream:outputStream: and ARC

2011-12-08 Thread Martin Linklater
Hi - I'm writing some OSX NSNetService code with ARC enabled, and I'm getting the following compile error with the following code: @property(strong) NSInputStream* inputStream; @property(strong) NSOutputStream* outputStream; - (void)netServiceDidResolveAddress:(NSNetService *)sender { [s

Re: NSNetService getInputStream:outputStream: and ARC

2011-12-08 Thread John Pannell
Some insights here - hope it helps! http://developer.apple.com/library/ios/#qa/qa1546/_index.html#//apple_ref/doc/uid/DTS40011324 John On Dec 8, 2011, at 3:11 PM, Martin Linklater wrote: > Hi - I'm writing some OSX NSNetService code with ARC enabled, and I'm getting > the following compile err

Re: NSNetService getInputStream:outputStream: and ARC

2011-12-08 Thread Ken Thomases
On Dec 8, 2011, at 4:11 PM, Martin Linklater wrote: > Hi - I'm writing some OSX NSNetService code with ARC enabled, and I'm getting > the following compile error with the following code: > > @property(strong) NSInputStream* inputStream; > @property(strong) NSOutputStream* outputStream; > > - (v

Re: NSNetService getInputStream:outputStream: and ARC

2011-12-08 Thread Martin Linklater
Thanks Ken - that did the trick. On 8 Dec 2011, at 22:17, Ken Thomases wrote: > On Dec 8, 2011, at 4:11 PM, Martin Linklater wrote: > >> Hi - I'm writing some OSX NSNetService code with ARC enabled, and I'm >> getting the following compile error with the following code: >> >> @property(strong)

Strange behivor when our document-based Cocoa application launch on lion

2011-12-08 Thread qiang zhu
Hello group, Our application use document-based architecture and works well on snow leopard, below are the call sequences: 1, when user launch our application, our application's delegate's method "- applicationOpenUntitledFile:" is called. 2, when user double click a document which our application

Singletons with ARC

2011-12-08 Thread Ben
I'm rather confused by the commonly used implementation of singletons. (Ignoring the fact that perhaps I shouldn't be using singletons) I would appreciate you view on this… Normally I implement a singleton such as.. static MyClass *sharedInstance = nil; + (MyClass *)sharedInstance { @sy

RE: Singletons with ARC

2011-12-08 Thread Abdul Sowayan
Hi Ben, >I'm rather confused by the commonly used implementation of singletons. >(Ignoring the fact that perhaps I shouldn't be using singletons) I would >appreciate you view on this. > >Normally I implement a singleton such as.. > >static MyClass *sharedInstance = nil; >+ (MyClass *)sharedInst

Re: Strange behivor when our document-based Cocoa application launch on lion

2011-12-08 Thread Jerry Krinock
On 2011 Dec 08, at 02:54, qiang zhu wrote: > Can anyone tell the cause or any cue to find the root cause will be > appreciated. A lot change in Lion. Read the section titled "NSDocumentController Asynchronous Opening and Reopening" in the Mac OS X Lion AppKit Release Notes, currently at http

Re: Singletons with ARC

2011-12-08 Thread Ken Thomases
On Dec 8, 2011, at 11:18 PM, Abdul Sowayan wrote: > Hi Ben, > >> I'm rather confused by the commonly used implementation of singletons. >> (Ignoring the fact that perhaps I shouldn't be using singletons) I would >> appreciate you view on this. >> >> Normally I implement a singleton such as.. >

Re: NSIndexSet of NSButtonCells in NSOutlineView

2011-12-08 Thread Graham Cox
On 09/12/2011, at 8:22 AM, Gilles Celli wrote: > how do I detect which set if NSButtonCells are active ? You need to track that in your dataSource, NSOutlineView will not do it for you. As Quincey suggested, when your dataSource method -outlineView:setObjectValue:forTableColumn:byItem: is inv

Re: Singletons with ARC

2011-12-08 Thread Uli Kusterer
On 09.12.2011, at 07:55, Ken Thomases wrote: > On Dec 8, 2011, at 11:18 PM, Abdul Sowayan wrote: >> The above will still work in an ARC environment. It is rather inefficient, >> however. For details please check the "Double Check Locking Optimization >> pattern": >> http://www.cs.wustl.edu/~schmi

Re: Singletons with ARC

2011-12-08 Thread Charles Srstka
On Dec 9, 2011, at 1:11 AM, Uli Kusterer wrote: > On 09.12.2011, at 07:55, Ken Thomases wrote: >> On Dec 8, 2011, at 11:18 PM, Abdul Sowayan wrote: >>> The above will still work in an ARC environment. It is rather inefficient, >>> however. For details please check the "Double Check Locking Optimi

Re: Safari downloader-like behavior

2011-12-08 Thread Nick
Thanks. And to have Lion Safari's download box like behavior I have to implement everything by myself? I am just wondering how difficult would it be. It seems to be a very customized NSTableView. There's no existing components at the moment? 2011/12/7 John Joyce : > That is weird. Calling that a

Re: Singletons with ARC

2011-12-08 Thread Ken Thomases
On Dec 9, 2011, at 1:11 AM, Uli Kusterer wrote: > On 09.12.2011, at 07:55, Ken Thomases wrote: >> >> Double-checked locking is broken. It is an anti-pattern in many languages, >> including the C family under most common implementations. Don't use it. >> Google it if you want to confirm. One