RE: NSXMLParser and initWithStream

2012-05-30 Thread John Drake
I figured out what the problem was and answering it here incase anyone else runs into this problem in the future since +[NSXMLParser initWithStream] doesn't have a lot lot of documentation out there.  I needed to call -[NSXMLParser parse] right after I allocate NSXMLParser and set myself as del

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 (w

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 Kyle Sluder
On May 30, 2012, at 7:54 PM, Marco S Hyman wrote: > In a sandboxed app that will be > /Users//Library/Containers//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, the behavior seeing

Re: NSSavePanel: Another sandbox issue

2012-05-30 Thread Marco S Hyman
> 3. When I use -setDirectoryURL: and the URL is somewhere in my sandbox, the > actual URL displayed is the old location, back in ~/Library/Application > Support (!) When using a sandbox in Mac OS X 10.7 and later, the home directory is the app’s container directory. That is ~ ==> /Users//Libr

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: 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(); >>CGContextSetAllowsAnti

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

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 acts

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

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 cu

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 corr

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 distribu

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 va

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 there

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 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 s

Re: Animating source view design advice.

2012-05-30 Thread Corbin Dunn
On May 30, 2012, at 11:37 AM, Demitri Muna 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 something more flexible

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 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. Alth

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 qui

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-

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

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 operat

Re: Sandboxing and "helper apps"

2012-05-30 Thread Stephane Sudre
On Wed, May 30, 2012 at 4:20 PM, Todd Heberlein 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 getting up to

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 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 hav

Re: NSDocument never deallocated with autosave/versions

2012-05-30 Thread Kyle Sluder
On May 30, 2012, at 7:40 AM, Graham Cox 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 somehow OK n

Re: Sandboxing. WTF?

2012-05-30 Thread Michael Nickerson
On May 28, 2012, at 5:51 AM, Graham Cox 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 that isn't > too

Re: Sandboxing. WTF?

2012-05-30 Thread Michael Nickerson
On May 28, 2012, at 5:51 AM, Graham Cox 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/. Then at runtime you use >> getpwuid() to find an absolute path to the

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 woul

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: NSDocument never deallocated with autosave/versions

2012-05-30 Thread Kyle Sluder
On May 30, 2012, at 8:13 AM, Graham Cox 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, since > NSDocume

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 fi

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: Sandboxing and "helper apps"

2012-05-30 Thread Stephane Sudre
On Wed, May 30, 2012 at 3:28 AM, Todd Heberlein 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 "my_helper_app". >

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 san

Re: NSDocument never deallocated with autosave/versions

2012-05-30 Thread Kyle Sluder
On May 29, 2012, at 10:05 PM, Graham Cox 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 'Don't > Save', th

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

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 ap

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