Re: cocoa app switching windows

2012-05-30 Thread Graham Cox
On 30/05/2012, at 3:52 PM, Martin Hewitson wrote: I have a report from a user that the usual cmd-` (command back-tick) doesn't work in my app for switching between open documents. I can't reproduce this on any of the test machines I have. Does anyone have any idea what could cause this

Re: cocoa app switching windows

2012-05-30 Thread Martin Hewitson
The claim is that it's working on other apps. Martin - Martin Hewitson AEI Hannover - On 30 May 2012, at 07:59, Graham Cox graham@bigpond.com wrote: On 30/05/2012, at 3:52 PM, Martin Hewitson wrote: I have a report from a user

Prompting for reboot programatically

2012-05-30 Thread Arun
Hi All Any one has a idea of how we can launch the prompt for Mac reboot from a Cocoa / Obj-C code? Thanks Arun KA ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the

Re: Prompting for reboot programatically

2012-05-30 Thread Jean-Daniel Dupas
Le 30 mai 2012 à 10:30, Arun a écrit : Hi All Any one has a idea of how we can launch the prompt for Mac reboot from a Cocoa / Obj-C code? You can use AppleEvent to ask the loginwindow to do it: I'm using the C AppleEvent API to do this, but in AppleScript it is equivalent to tell

Re: NSDocument never deallocated with autosave/versions

2012-05-30 Thread Mike Abdullah
I guess you should implement -[NSDocument close] to do your cleanup then. On 30 May 2012, at 04:30, Graham Cox wrote: Well well. This leak only occurs if I have sandboxing enabled. What a surprise! The save dialog is not releasing the document when it closes if sandboxing is turned on.

Re: NSDocument never deallocated with autosave/versions

2012-05-30 Thread Kyle Sluder
On May 29, 2012, at 10:05 PM, Graham Cox graham@bigpond.com wrote: The key object that seems never to release my document is the NSSavePanel that is displayed only when I have added content, and I close the window. The save panel is shown, and the retain count shoots right up. If I click

Re: Sandboxing. WTF?

2012-05-30 Thread Phillip Mills
On 2012-05-29, at 11:30 PM, Quincey Morris wrote: A number of commentators have jumped into the thread to declare, in effect, that the sandboxing could *never* work. Such a point of view seems inexplicably to ignore the fact that there is a platform out there already (iOS) for which

Re: Sandboxing and helper apps

2012-05-30 Thread Stephane Sudre
On Wed, May 30, 2012 at 3:28 AM, Todd Heberlein todd_heberl...@mac.com wrote:  In the past you could include a full UNIX application inside a Mac application bundle. For example, in the directory        MyApp.app/Contents/MacOS could be the Cocoa executable MyApp and the UNIX executable

Lion : Sandboxing and IKCameraDeviceView

2012-05-30 Thread Feedback RhapSoft
Hi, We are using ImageKit API (IKScannerDeviceView, IKCameraDeviceView) to import images from cameras and scanners. Importing worked on Snow Leopard and Lion without sandboxing. With sandboxing it doesn't. If download directory is visible (displaysDownloadsDirectoryControl == YES) and user use

Re: NSDocument never deallocated with autosave/versions

2012-05-30 Thread Graham Cox
On 30/05/2012, at 8:55 PM, Kyle Sluder wrote: Key point: If I disable autosaving for my document class, the document is deallocated as expected. Do you override any of the saving methods and fail to call their completion handlers in the Don't Save case? No; I only override the

Re: NSDocument never deallocated with autosave/versions

2012-05-30 Thread Kyle Sluder
On May 30, 2012, at 8:13 AM, Graham Cox graham@bigpond.com wrote: I guess you should implement -[NSDocument close] to do your cleanup then. Indeed, I have done. But that doesn't fix the bug, it only mitigates its effects. A leak is still there, and it's a potentially quite large one,

Re: NSDocument never deallocated with autosave/versions

2012-05-30 Thread Graham Cox
On 30/05/2012, at 10:19 PM, Kyle Sluder wrote: Surely you can invalidate your data model within -close? How does NSDocument otherwise have a handle on it? Of course I can, but that surely isn't the point. Are leaks somehow OK now? --Graham

Re: Sandboxing and helper apps

2012-05-30 Thread Todd Heberlein
On May 30, 2012, at 4:53 AM, Stephane Sudre wrote: It's allowed. IIRC, when the helper app is launched from the main application, it inherits the entitlements/restrictions of its parent. I thought (and I'm barely getting up to speed on this) if the program was launched as an NSTask, it would

Re: Sandboxing. WTF?

2012-05-30 Thread Michael Nickerson
On May 28, 2012, at 5:51 AM, Graham Cox graham@bigpond.com wrote: On 28/05/2012, at 7:31 PM, Roland King wrote: The way I read it is you register the entitlement exactly as you have been doing, as a user entitlement to Library/whatever. Then at runtime you use getpwuid() to find an

Re: Sandboxing. WTF?

2012-05-30 Thread Michael Nickerson
On May 28, 2012, at 5:51 AM, Graham Cox graham@bigpond.com wrote: That sounds fine, except that CFPreferencesCopyAppValue doesn't take a path, just a bundle ID and key. I can't see an alternative API that takes a path - are you saying I have to open the file and parse it myself? While

Re: NSDocument never deallocated with autosave/versions

2012-05-30 Thread Kyle Sluder
On May 30, 2012, at 7:40 AM, Graham Cox graham@bigpond.com wrote: On 30/05/2012, at 10:19 PM, Kyle Sluder wrote: Surely you can invalidate your data model within -close? How does NSDocument otherwise have a handle on it? Of course I can, but that surely isn't the point. Are leaks

Re: Sandboxing. WTF?

2012-05-30 Thread Jean-Daniel Dupas
Le 30 mai 2012 à 16:56, Michael Nickerson a écrit : On May 28, 2012, at 5:51 AM, Graham Cox graham@bigpond.com wrote: That sounds fine, except that CFPreferencesCopyAppValue doesn't take a path, just a bundle ID and key. I can't see an alternative API that takes a path - are you

Re: Sandboxing and helper apps

2012-05-30 Thread Stephane Sudre
On Wed, May 30, 2012 at 4:20 PM, Todd Heberlein todd_heberl...@mac.com wrote: On May 30, 2012, at 4:53 AM, Stephane Sudre wrote: It's allowed. IIRC, when the helper app is launched from the main application, it inherits the entitlements/restrictions of its parent. I thought (and I'm barely

Re: Sandboxing. WTF?

2012-05-30 Thread Preston Sumner
On May 29, 2012, at 8:03 PM, Shawn Bakhtiar wrote: Users will vote with their downloads, if a developer is a bad one and leaves his/her app vulnerable to other apps, then user will become wise, and stop using it. It is NOT the place of the hardware/OS vendor to be the cop. Modern operating

Re: Sandboxing. WTF?

2012-05-30 Thread Mike Abdullah
On 30 May 2012, at 16:07, Jean-Daniel Dupas wrote: Le 30 mai 2012 à 16:56, Michael Nickerson a écrit : It does not solve the main issue. You assume the preferences are stored in property list, which is something not documented. Nothing prevent Apple to change it again to an other

Document Window Ignoring Size Settings

2012-05-30 Thread Gordon Apple
(10.7) I have a small (but resizable) initial window that is the only one I want open on the main screen when the document is launched. The app has numerous other document windows, one of which is normally full-screen on a second monitor. If I quit (usually through xcode while debugging) and

Re: Document Window Ignoring Size Settings

2012-05-30 Thread Conrad Shultz
On 5/30/12 10:52 AM, Gordon Apple wrote: (10.7) I have a small (but resizable) initial window that is the only one I want open on the main screen when the document is launched. The app has numerous other document windows, one of which is normally full-screen on a second monitor. If I quit

Re: Animating source view design advice.

2012-05-30 Thread Demitri Muna
Just because I hate orphaned questions (as no one answered), I thought I'd answer my own question. Most examples that use Core Data/bindings/array controllers use a table view as the source view, but I wanted something more flexible with my own custom view that involved a little animation.

Re: Document Window Ignoring Size Settings

2012-05-30 Thread lbland
hi- On May 30, 2012, at 1:52 PM, Gordon Apple wrote: How can I stop this annoying behavior and always get the correct specified size, and on the main screen? Maybe in the Xcode (IB) Window's Attributes inspector uncheck Restorable. thanks!- -lance

Re: Animating source view design advice.

2012-05-30 Thread Corbin Dunn
On May 30, 2012, at 11:37 AM, Demitri Muna thatsanicehatyouh...@me.com wrote: Just because I hate orphaned questions (as no one answered), I thought I'd answer my own question. Most examples that use Core Data/bindings/array controllers use a table view as the source view, but I wanted

Re: Sandboxing. WTF?

2012-05-30 Thread Nick Zitzmann
On May 29, 2012, at 9:30 PM, Quincey Morris wrote: A number of commentators have jumped into the thread to declare, in effect, that the sandboxing could *never* work. Such a point of view seems inexplicably to ignore the fact that there is a platform out there already (iOS) for which

Re: Document Window Ignoring Size Settings

2012-05-30 Thread Gordon Apple
Thanks. That seems to have solved the immediate problem. However, it doesn’t help me understand why this thing is getting confused about where its windows should be. I looked at the Handling Window Restoration methods, but I think it will take awhile to figure out how to use them. On 5/30/12

Re: Sandboxing. WTF?

2012-05-30 Thread Alex Kac
But that is why not everything has to be sandboxed. For my mom I'd prefer apps to be sandboxed. For myself I'll have the variety of the internet plus what's on the App Store to choose from. I don't see the problem. Nobody is forcing you to sell on the App Store. Some apps simply won't work

Re: Sandboxing. WTF?

2012-05-30 Thread Jean-Daniel Dupas
It would be true if Apple didn't start to limit availability of some API to sandboxed application distributed using the MAS. Le 30 mai 2012 à 23:20, Alex Kac a écrit : But that is why not everything has to be sandboxed. For my mom I'd prefer apps to be sandboxed. For myself I'll have the

Re: Sandboxing. WTF?

2012-05-30 Thread Alex Kac
The only ones I know of are iCloud and gamecenter - stuff that works with their network. I can understand their thinking for that. On May 30, 2012, at 4:30 PM, Jean-Daniel Dupas wrote: It would be true if Apple didn't start to limit availability of some API to sandboxed application

Managed Objects and Contexts

2012-05-30 Thread Richard Somers
I have a question about multiple contexts. First a quote from the Core Data Programming Guide - To consider this from a different perspective, a given object in a persistent store may be edited in more than one context simultaneously. Each context, however, has its own managed object that

Re: Sandboxing. WTF?

2012-05-30 Thread Graham Cox
On 31/05/2012, at 12:56 AM, Michael Nickerson wrote: The CFPreferences... calls will actually take a path. Just give it the path where the bundle ID should go. This is not documented anywhere, but it works. Hmmm... well, relying on undocumented behaviour sounds like it could be a worse

Re: Managed Objects and Contexts

2012-05-30 Thread John Pannell
Hi Richard- The reasons to have multiple contexts within an app are as varied as application architectures, and do not need to correspond to multiple users (I'd go so far as to say shouldn't, but I'm sure someone could find a way to make it work). An app I once wrote maintained two contexts

NSSavePanel: Another sandbox issue

2012-05-30 Thread Graham Cox
In my app I put up a save panel to save a file in a particular place within my ~/Library/Application Support folder. When not sandboxed, this works fine. When sandboxed, the URL that is set in the panel is correct (it's inside the sandbox now), but the save panel doesn't appear. In fact, it

Re: NSSavePanel: Another sandbox issue

2012-05-30 Thread Graham Cox
[savePanel beginSheetModalForWindow:[self windowForSheet] completionHandler:completionHandler]; Anyone else come across this issue? My understanding is that with sandboxing, the save panel is a bit more involved since it has to open up holes in the sandbox on behalf of the user,

Re: Transforming UIImage (rotate, translate, scale) and then crop to constant size

2012-05-30 Thread David Duncan
On May 25, 2012, at 1:07 AM, Gustavo Adolfo Pizano wrote: sorry clicked wrong button and send before finishing the email. so, after this UIGraphicsBeginImageContext(size) //size is a CGSize with 900x567 CGContextRef ctx = UIGraphicsGetCurrentContext();

Re: NSSavePanel: Another sandbox issue

2012-05-30 Thread Graham Cox
On 31/05/2012, at 9:57 AM, Graham Cox wrote: So, internally the panel is throwing an exception, due to a nil object. But why? what am I doing wrong here? OK, some more discoveries. 1. The problem only occurs with a delegate set on the panel. The delegate isn't called - just its presence

Re: NSSavePanel: Another sandbox issue

2012-05-30 Thread Kyle Sluder
On May 30, 2012, at 7:54 PM, Marco S Hyman m...@snafu.org wrote: In a sandboxed app that will be /Users/user/Library/Containers/app/Data/Documents/ What? No! The whole point of sandboxing and NSSavePanel is that Powerbox will poke holes into the user's *actual* Documents directory. Graham,

Re: NSSavePanel: Another sandbox issue

2012-05-30 Thread Graham Cox
On 31/05/2012, at 12:54 PM, Marco S Hyman wrote: The user doesn't know or care what the actual path is. Why are you trying to show it in a save dialog. I don't, as such, but the save panel shows the full path and it's simply wrong. I have a specific location inside my Application Support

Re: NSSavePanel: Another sandbox issue

2012-05-30 Thread Roland King
P.S. Just saw this: http://www.macworld.com.au/news/ac-devs-air-frustrations-at-mac-app-store-sandboxing-debacle-55502/ I would say that's a pretty reasonable article about the current state of sandboxing as I understand it. I've given up for a while on the OSX thing I was writing