Re: ARC and Singletons

2011-08-02 Thread Jean-Daniel Dupas
Le 2 août 2011 à 08:22, Karl Goiser a écrit : > Yes they are. > > > They are a kludge that came about because C++ doesn’t implement object > behaviour properly. > > Try this: http://www.google.com/search?hl=en&q=Singleton%2Bevil > > > You have not said what about NSFileManager is a great ex

quick look question

2011-08-02 Thread Rick C.
Hi all, I want to include this feature in my app and the way I want it to work is if a user selects a file in my table view and clicks a button it will open that file in a quick look panel just the way it works in Finder. Actually if there was only a way to trigger that easily like NSWorkspace

Re: quick look question

2011-08-02 Thread jonat...@mugginsoft.com
On 2 Aug 2011, at 11:39, Rick C. wrote: > Hi all, > > I want to include this feature in my app and the way I want it to work is if > a user selects a file in my table view and clicks a button it will open that > file in a quick look panel just the way it works in Finder. Actually if > there

Long delay of NSPopUpButton first click

2011-08-02 Thread Rimas M.
Hello list, I am trying to do quite simple thing - add a popup with all fonts, available on system. Each item of menu, should be displayed in corresponding font. As an example could be all iWork apps. When you dealing with text, you have a popup with fonts, and each font name is displayed with "pr

Re: Long delay of NSPopUpButton first click

2011-08-02 Thread Glenn L. Austin
On Aug 2, 2011, at 6:42 AM, Rimas M. wrote: > Hello list, > > I am trying to do quite simple thing - add a popup with all fonts, available > on system. Each item of menu, should be displayed in corresponding font. As > an example could be all iWork apps. When you dealing with text, you have a > p

How to detect Time Machine volume?

2011-08-02 Thread Leonardo Borsten
Hello, What is the most reliable way to detect in code if a mounted volume is the Time Machine disk? Currently I'm using the following code (also to detect a Boot Camp volume): - (Boolean)isNotSearchable:(NSString *)volumePath { NSFileManager *fm = [NSFileManager defaultManager];

Cocoa AppleScript

2011-08-02 Thread John Nairn
I have always run AppleScripts with a single Cocoa call: NSAppleEventDescriptor *result=[script executeAndReturnError:&errorInfo]; but things seemed to have change in Lion. The first symptom is that scripts that used to run fine, now quit with an "AppleEvent timed out" error. The only one

Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?

2011-08-02 Thread Wade Tregaskis
>> That'll need to be updated. If you look at the @autoreleasepool section of >> the ARC documentation, it specifically states that crossing out of one via >> an exception will not drain the pool. There doesn't appear to be any way, >> even through compiler flags, to change this. > > If an au

Re: How to detect Time Machine volume?

2011-08-02 Thread Stephane Sudre
This code would work in most cases but is actually unreliable. Obvious cases: you have 2 text files with these names ar the root of a partition. Worse case: an old time machine partition has been replaced by a new one. Since the old partition is some kind of a second backup, the user has not remov

Re: Cocoa-dev Digest, Vol 8, Issue 595

2011-08-02 Thread Bill Monk
On Aug 2, 2011, at 12:40 PM, cocoa-dev-requ...@lists.apple.com wrote: > Send Cocoa-dev mailing list submissions to > cocoa-dev@lists.apple.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.apple.com/mailman/listinfo/cocoa-dev > or, via email, send a mes

Re: Cocoa-dev Digest, Vol 8, Issue 595

2011-08-02 Thread Bill Monk
mea culpa for the noise - that was a mis-click. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/U

Re: How to detect Time Machine volume?

2011-08-02 Thread Charles Srstka
On Aug 2, 2011, at 12:37 PM, Stephane Sudre wrote: > Worse case: an old time machine partition has been replaced by a new > one. Since the old partition is some kind of a second backup, the user > has not removed the Time Machine files. Depending on what he wants to do, this may not be a relevant

Accessory NSPanel vanishes on first click after app launches

2011-08-02 Thread Peter
Developing for OS 10.5 and 10.6 I have an application with a main window (no documents window) and a (non-modal) accessory NSPanel I want to show only when the main window is the key window. I want the NSPanel hidden, however, when the preferences or about window comes up or when the app is in t

Messaging app/Whatsapp send button design

2011-08-02 Thread Dan Hopwood
This has to be an incredibly simple question but no amount of googling has rendered an answer. So, to ask the cocoa dev community :) All I want to know is whether the 'Send' button found in the Messages and Whatsapp apps is a built in button or whether Whatsapp cribbed the design and applied a cus

Re: Double-click a main window's title bar to minimize

2011-08-02 Thread Sean McBride
On Tue, 19 Jul 2011 08:59:26 -0700, Satoshi Nakagawa said: >Is there a way to read "Double-click a main window's title bar to >minimize" setting in Appearance tab in the system preferences? > >I want to read the setting in my code to make a custom window work >with the setting. I doubt there's an

Re: ARC and Singletons

2011-08-02 Thread Greg Parker
On Aug 1, 2011, at 9:02 PM, Kyle Sluder wrote: > if we had class storage (which in practice would be no different from > static global variables except for scope), class methods would still > be appropriate for a different set of tasks. Not necessarily. Class variables could be defined differently

Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?

2011-08-02 Thread Martin Wierschin
>> When you unarchive one of those strings, code expecting an instance of >> UnencodableFoo will instead have an NSString, the use of which will likely >> throw exceptions, eg: when code calls -[UnencodableFoo fooThing] > > No, it's not likely if UnencodableFoo is *my* code, because I program >

Accessory NSPanel vanishes on first click after app launches - Follow up

2011-08-02 Thread Peter
After setting a breakpoint at -[NSWindow orderOut:] (thanks for this and other hints to Kyle Sluder! - in a post on this list about a year ago) it turns out that it is exactly my - (void)windowDidResignKey:(NSNotification *)notification which takes the panel off the screen. (I wonder why I hadn

Re: Accessory NSPanel vanishes on first click after app launches - Follow up

2011-08-02 Thread Peter
I forgot to add: Using - (void)windowDidBecomeMain:(NSNotification *)notification - (void)windowDidResignMain:(NSNotification *)notification make the panel stay on the screen after the first mouse click, but on the other hand do not achieve the desired effect, i.e. remove the panel when other

Re: [Solved] Section header artifacts in popover

2011-08-02 Thread Conrad Shultz
After much exploration I found that the problem was resolved by setting the autoresizing mask of the parent tableView to flexible height/width. This did not occur to me earlier because, as I mentioned, visually everything resized properly. I'm unclear whether this is a framework bug or confusio

Re: How can i change a app position and size?

2011-08-02 Thread Diego Alvarez Nogueira
Thank you, But i have one more doubt: How can i get the WindowID(window number) using AXUIElementRef? There is a way to get this? AXUIElementRef element = AXUIElementCreateApplication(pid); Thanks! On 27/07/2011, at 13:30, David Duncan wrote: > On Jul 26, 2011, at 6:14 PM, Diego Alvarez No

Re: Debugging "CGImageCreate: invalid image provider: NULL"?

2011-08-02 Thread Izak van Langevelde
Just noticed that using the CGDataProviderRef with callback for data release yields a memory leak: CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, buffer, len, imageDataRelease); CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); cgImageRef = CGImageCreate(width,

Re: Debugging "CGImageCreate: invalid image provider: NULL"?

2011-08-02 Thread David Duncan
On Aug 2, 2011, at 2:52 PM, Izak van Langevelde wrote: > However, Instruments shows a leaked Malloc of 236K with as responsible Caller > CGDataProviderCopyData, which makes no sense to me. Something else (possibly out side of your control) called CGDataProviderCopyData and didn't release the d

Re: Debugging "CGImageCreate: invalid image provider: NULL"?

2011-08-02 Thread Izak van Langevelde
On 2011-08-02, at 6:02 PM, David Duncan wrote: > On Aug 2, 2011, at 2:52 PM, Izak van Langevelde wrote: > >> However, Instruments shows a leaked Malloc of 236K with as responsible >> Caller CGDataProviderCopyData, which makes no sense to me. > > > Something else (possibly out side of your con

Re: Debugging "CGImageCreate: invalid image provider: NULL"?

2011-08-02 Thread David Duncan
On Aug 2, 2011, at 3:34 PM, Izak van Langevelde wrote: > > On 2011-08-02, at 6:02 PM, David Duncan wrote: > >> On Aug 2, 2011, at 2:52 PM, Izak van Langevelde wrote: >> >>> However, Instruments shows a leaked Malloc of 236K with as responsible >>> Caller CGDataProviderCopyData, which makes no

Re: Debugging "CGImageCreate: invalid image provider: NULL"?

2011-08-02 Thread Izak van Langevelde
On 2011-08-02, at 6:57 PM, David Duncan wrote: > On Aug 2, 2011, at 3:34 PM, Izak van Langevelde wrote: > >> >> On 2011-08-02, at 6:02 PM, David Duncan wrote: >> >>> On Aug 2, 2011, at 2:52 PM, Izak van Langevelde wrote: >>> However, Instruments shows a leaked Malloc of 236K with as resp

Re: ARC and Singletons

2011-08-02 Thread Karl Goiser
Hi Greg, Is that wishful thinking or a hint about the future? :-) All I have to say is: yes please!! Regards, Karl On 03/08/2011, at 5:43 AM, Greg Parker wrote: > On Aug 1, 2011, at 9:02 PM, Kyle Sluder wrote: >> if we had class storage (which in practice would be no different from >> stat

Re: ARC and Singletons

2011-08-02 Thread Dave Zarzycki
Karl, This is not on our todo list or any list that I know of. Please file a bug report if this enhancement request is interesting to you. Thanks! :-) davez On Aug 2, 2011, at 4:59 PM, Karl Goiser wrote: > Hi Greg, > > Is that wishful thinking or a hint about the future? > :-) > > > All I

Crasher due to unsafe block implementation in -[NSTextView checkTextInRange:types:options:]?

2011-08-02 Thread Thomas Bunch
Hello, fellow cocoa devs. I'm running down the most common crasher we're seeing in OmniPlan-2.0 under Lion and running onto some grief with NSSpellChecker/NSTextView. We have a fairly complex outline view that is backed by many text storages and the field editor is asked to do a lot. When edit

Unnecessary Boolean Warning

2011-08-02 Thread Dale Miller
Greg Parker wrote: "A warning on '==' inside of 'if' is ridiculous. '==' is comparison for equality. "=' is assignment. Anyone who can't at least keep these two straight shouldn't be doing programming." I'm glad that my bosses failed to discover my incompetence in my 40+years of programming i

Re: Unnecessary Boolean Warning

2011-08-02 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/2/11 5:57 PM, Dale Miller wrote: > Greg Parker wrote: "A warning on '==' inside of 'if' is ridiculous. > '==' is comparison for equality. "=' is assignment. Anyone who can't > at least keep these two straight shouldn't be doing programming." ... >

Re: Crasher due to unsafe block implementation in -[NSTextView checkTextInRange:types:options:]?

2011-08-02 Thread Aki Inoue
Hi Tom, Definitely write a Radar. One thing you could try is overriding both -checkTextInRange:types:options: & -handleTextCheckingResults:forRange:types:options:orthography:wordCount: for your field editor. You can have some kind of the field editor session ID. Every time a new field editor

Re: Crasher due to unsafe block implementation in -[NSTextView checkTextInRange:types:options:]?

2011-08-02 Thread Kyle Sluder
On Tue, Aug 2, 2011 at 6:09 PM, Aki Inoue wrote: > Hi Tom, > > Definitely write a Radar. I just got this distilled down into an extremely simple demo project. rdar://problem/9886471 The demo project is here for any interested third parties: http://db.tt/7hA7i8m > One thing you could try is over

Re: Unnecessary Boolean Warning

2011-08-02 Thread Dale Miller
Conrad Shultz notified me that I had misinterpreted Greg Parker's post. I will recant my accusation of hubris and apologize. Dale Miller ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comme

iOS camera image resolution selection

2011-08-02 Thread Nathan Sims
When retrieving an image from the iPad's rear camera, I remember there being an API that would allow you to select from a number of resolutions, ranging from thumbnail up to native. Where would I find this information? I'm trying to find out, among other things, if the iPad can return a 640x480

Re: quick look question

2011-08-02 Thread Rick C.
Awesome thank you! I had seen one for thumbnails but I didn't realize there was one that called qlmanage. I'll check it out! On Aug 2, 2011, at 7:00 PM, jonat...@mugginsoft.com wrote: > > On 2 Aug 2011, at 11:39, Rick C. wrote: > >> Hi all, >> >> I want to include this feature in my app an

Re: Unnecessary Boolean Warning

2011-08-02 Thread Charles Srstka
On Aug 2, 2011, at 7:57 PM, Dale Miller wrote: > It is disconcerting that if A = 0x'0110' and B = '1001' then A & B returns > true but A && B returns 0, so "if (A && B)' is executed, the 'true' leg is > not taken Don’t you have that backwards? Assuming B was supposed to be hex, i.e. 0x1001, th