Getting QuickLook to work with NSDocument

2014-02-08 Thread Pax
I'm trying to get QuickLook preview to work with NSDocument - much as in the QuickLookDownloader example provided by Apple. I thought I had it all set up correctly - #import Quartz/Quartz.h @interface Document : NSDocument NSToolbarDelegate,QLPreviewPanelDataSource, QLPreviewPanelDelegate {

Re: Managing image loading

2014-02-08 Thread Leonardo
Thank you Jens. I have found the proper way to manage that. When the user imports a new image, I quickly copy the image to a temporary folder, then I add this latest file reference to the document¹s NSFileWrapper. I just create the file¹s fileWrapper using its URL, so I do not read its content and

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread David Delmonte
I realized I could do this: 1. use just an NSTextField, and 2. if (hiding) textField.stringValue = @**; Is there something I'm missing? On Feb 7, 2014, at 7:44 PM, Kyle Sluder k...@ksluder.com wrote: On Fri, Feb 7, 2014, at 04:27 PM, David Delmonte wrote: Hi, Is there a way to turn

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Uli Kusterer
On 08 Feb 2014, at 14:37, David Delmonte ddelmo...@mac.com wrote: On Feb 7, 2014, at 7:44 PM, Kyle Sluder k...@ksluder.com wrote: On Fri, Feb 7, 2014, at 04:27 PM, David Delmonte wrote: Hi, Is there a way to turn secureTextField on and off in Cocoa? I'd like users to have the option to see

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Mike Abdullah
http://www.mikeabdullah.net/kspasswordfield.html On 8 Feb 2014, at 00:27, David Delmonte ddelmo...@mac.com wrote: Hi, Is there a way to turn secureTextField on and off in Cocoa? I'd like users to have the option to see their passwords. In iOS, I can do something like [textField

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread David Delmonte
@Mike. Thanks I'll look at this - I knew I wouldn't have to reinvent the wheel. However: @Uli. My little solution actually works rather nicely (at least in Greek and English). When the user enters a new password, it overwrites the asterisks (I'll change them to bullets), and the user can see

Re: NSWindow remember whether showing on re-launch

2014-02-08 Thread Michael Babin
On Feb 7, 2014, at 11:43 PM, Roland King r...@rols.org wrote: I have a window in my OSX application which shows a log of commands. It's not 'Visible At Launch' because you often don't need to see it. It's also excluded from the windows menu, instead it has its own permanent menu item on

Re: NSWindow remember whether showing on re-launch

2014-02-08 Thread Michael Babin
On Feb 8, 2014, at 9:45 AM, Michael Babin mba...@orderndev.com wrote: On Feb 7, 2014, at 11:43 PM, Roland King r...@rols.org wrote: I have a window in my OSX application which shows a log of commands. It's not 'Visible At Launch' because you often don't need to see it. It's also excluded

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Kyle Sluder
On Feb 8, 2014, at 5:37 AM, David Delmonte ddelmo...@mac.com wrote: I realized I could do this: 1. use just an NSTextField, and 2. if (hiding) textField.stringValue = @**; Is there something I'm missing? Please don't do this. NSSecureTextFieldCell uses a custom field editor that

Re: Managing image loading

2014-02-08 Thread Kyle Sluder
On Feb 8, 2014, at 3:58 AM, Leonardo mac.iphone@gmail.com wrote: I had to scratch my head at managing the undo, but I found a solution here too. When the user undo the import of an image, if the images has been never saved, so it is still within the temporary folder, I just remove the

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Gary L. Wade
Yeah, that demo issue came up yesterday, so I filed my own rdar://16013973 and as you know, it always helps to add duplicates! I marked mine as an issue with Security and Always. I suggested only showing the hints on the actual device and doing a secondary broadcast without the hint on secondary

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Kyle Sluder
On Feb 8, 2014, at 10:06 AM, Gary L. Wade garyw...@desisoftsystems.com wrote: Yeah, that demo issue came up yesterday, so I filed my own rdar://16013973 and as you know, it always helps to add duplicates! I marked mine as an issue with Security and Always. I suggested only showing the

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Steve Bird
On Feb 8, 2014, at 10:39 AM, David Delmonte ddelmo...@mac.com wrote: When the user enters a new password, it overwrites the asterisks (I'll change them to bullets), and the user can see what he/she is writing. I never understood why people can't see what they are typing in. — So the folks

Design pattern for bulk data handling

2014-02-08 Thread Ben
Hi list, I'm looking for the right design pattern for providing different types of access to an SQLite database. Currently I have a database object where queries are run on a serial NSOperationQueue and each operation has a completion block for reporting its results. The operation queue is an

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Gary L. Wade
Very true, and that's why I asked Apple in a Radar to fix it since, if it CAN be done, they're more in a position to do it (masters of the hardware and software) than relying upon each developer to make secondary screens. Maybe the hint text could be a layer not available for secondary device

makeDocumentForURL:nil withContentsOfURL:fileURL causing deletion

2014-02-08 Thread Trygve Inda
I am reading a document in the format of the old version of my app and converting it to a new format. The old version is not a document at all but is a fixed data file in /Application Support/MyApp/ MyDocument *untitledDoc = [[NSDocumentController sharedDocumentController] makeDocumentForURL:nil

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread David Delmonte
I am deferring to the expertise here and will use Mike Abdullah's password logic. However, this app is being designed for use at home - or - I admit - on portables. This is not a corporate entity. I'm not claiming my app is secure: It's a bit better than writing your password on an envelope. I

Re: makeDocumentForURL:nil withContentsOfURL:fileURL causing deletion

2014-02-08 Thread Markus Spoettl
On 2/8/14 8:43 PM, Trygve Inda wrote: I am reading a document in the format of the old version of my app and converting it to a new format. The old version is not a document at all but is a fixed data file in /Application Support/MyApp/ MyDocument *untitledDoc = [[NSDocumentController

Re: makeDocumentForURL:nil withContentsOfURL:fileURL causing deletion

2014-02-08 Thread Markus Spoettl
On 2/8/14 9:31 PM, Markus Spoettl wrote: On 2/8/14 8:43 PM, Trygve Inda wrote: I am reading a document in the format of the old version of my app and converting it to a new format. The old version is not a document at all but is a fixed data file in /Application Support/MyApp/ MyDocument

Re: NSToolbar delegate -toolbarAllowedItemIdentifiers:

2014-02-08 Thread Markus Spoettl
On 2/8/14 12:25 AM, Quincey Morris wrote: It’s a while since I had to suffer through the pain that is NSToolbar delegate methods, but I suspect the problem is that the IB-created items are in a different universe from programmatically created ones. Therefore, in a “mixed” configuration,

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Jens Alfke
On Feb 8, 2014, at 12:04 PM, David Delmonte ddelmo...@mac.com wrote: However, this app is being designed for use at home - or - I admit - on portables. This is not a corporate entity. Doesn't matter. Individual people have just as much right to security as corporations do. Home computers

Re: Design pattern for bulk data handling

2014-02-08 Thread Jens Alfke
On Feb 8, 2014, at 10:20 AM, Ben ben_cocoa_dev_l...@yahoo.co.uk wrote: This is fine for most things, except that I sometimes need faster access to the underlying database - for example, when importing/exporting data. In these cases I'm after bulk data throughput without the overhead of

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread David Delmonte
On Feb 8, 2014, at 5:22 PM, Jens Alfke j...@mooseyard.com wrote: On Feb 8, 2014, at 12:04 PM, David Delmonte ddelmo...@mac.com wrote: However, this app is being designed for use at home - or - I admit - on portables. This is not a corporate entity. Doesn't matter. Individual people have

Re: Design pattern for bulk data handling

2014-02-08 Thread Tito Ciuro
Also, consider dropping the table indexes before you start inserting. After the you're done inserting, rebuild the indexes. This should give you an an additional performance boost. For even more speed, consider turning off the following setting:

Re: Design pattern for bulk data handling

2014-02-08 Thread Jens Alfke
On Feb 8, 2014, at 2:54 PM, Tito Ciuro tci...@mac.com wrote: For even more speed, consider turning off the following setting: http://www.sqlite.org/pragma.html#pragma_synchronous (This is getting slightly off-topic, but…) The only time I'd set synchronous to OFF is while populating a _new_

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Jens Alfke
On Feb 8, 2014, at 2:51 PM, David Delmonte ddelmo...@mac.com wrote: Yep, I'm implementing EvenBetterAuthorizationSample code now. Does make me sad to have to do this. I help older people use technology. They are always forgetting their passwords. Just trying to help.. The best way to do

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread David Delmonte
Good advice. Thanks Jens. Do you know of any samples that employ good behavior? Right now, I'm playing with SMJobBless. Finally, does anyone know if the Mac App Store would accept an app with elevated permissions (admin permissions to enter a password)? (or am I confusing things?) On Feb 8,

Re: Managing image loading

2014-02-08 Thread Jens Alfke
On Feb 8, 2014, at 3:58 AM, Leonardo mac.iphone@gmail.com wrote: When the user imports a new image, I quickly copy the image to a temporary folder, then I add this latest file reference to the document’s NSFileWrapper. I just create the file’s fileWrapper using its URL, so I do not read

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread SevenBits
On Saturday, February 8, 2014, David Delmonte ddelmo...@mac.com wrote: Good advice. Thanks Jens. Do you know of any samples that employ good behavior? Right now, I'm playing with SMJobBless. Finally, does anyone know if the Mac App Store would accept an app with elevated permissions (admin

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread David Delmonte
That's my understanding as well. So what to do? On Feb 8, 2014, at 10:21 PM, SevenBits sevenbitst...@gmail.com wrote: On Saturday, February 8, 2014, David Delmonte ddelmo...@mac.com wrote: Good advice. Thanks Jens. Do you know of any samples that employ good behavior? Right now, I'm

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Kyle Sluder
On Feb 8, 2014, at 7:31 PM, David Delmonte ddelmo...@mac.com wrote: That's my understanding as well. So what to do? Pretty clear that you can’t sell the app via the App Store. You could sell it via your own site (with proper code signing so that Gatekeeper lets you through). Or you could

dispatch_apply strange results

2014-02-08 Thread Gerriet M. Denkmann
I am trying to optimise a Cocoa app which spends most of it's time in a for-loop looking at the bytes of a huge array. So I decided to use dispatch_apply to divide the work of the for-loop onto different cpus (I seem to have 8 of them). Note: no two threads ever share a common byte of this