Sandboxing and ABAddressBook

2013-05-20 Thread Gideon King
Hi, I have address book data access enabled, but when I do a [ABAddressBook sharedAddressBook] in applicationDidFinishLaunching, it generates a series of sandbox deny file-read-data messages. Interestingly, if I then ask it for "me" it returns correct data, so whatever the messages are, it do

NSDocument initWithContentsOfURL vs readFromURL

2013-05-20 Thread Trygve Inda
When I open a document from a file (double clicking or via File-Open), my Document object gets -(id)initWithContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError It seems like I could just read the file there and load it into my internal structures in my Docume

Sandboxing and Apple System Log (asl) searches

2013-05-20 Thread Gideon King
Hi, In my application, I want to be able to collect Apple system log information about my application, and have been using asl_new(ASL_TYPE_QUERY); to do so. Unfortunately this needs to access any files in /private/var/log/asl/* I understand that there is no way to add an entitlement that will

Re: NSDocument initWithContentsOfURL vs readFromURL

2013-05-20 Thread Mike Abdullah
On 20 May 2013, at 11:29, Trygve Inda wrote: > When I open a document from a file (double clicking or via File-Open), my > Document object gets > > -(id)initWithContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName > error:(NSError **)outError > > It seems like I could just read the f

Widow / Orphan protection in text layout

2013-05-20 Thread Gideon King
Hi, I have inherited some code which has a subclass of NSATSTypesetter in it, and in the -willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset: method it works out whether it needs to put a page break in, and directly sets the currentTextContainer, currentTextContainerIndex, and curren

Re: Sandboxing and Apple System Log (asl) searches

2013-05-20 Thread Kyle Sluder
On May 20, 2013, at 5:53 AM, Gideon King wrote: > Hi, > > In my application, I want to be able to collect Apple system log information > about my application, and have been using asl_new(ASL_TYPE_QUERY); to do so. > > Unfortunately this needs to access any files in /private/var/log/asl/* > >

Re: Widow / Orphan protection in text layout

2013-05-20 Thread Kyle Sluder
On May 20, 2013, at 7:26 AM, Gideon King wrote: > Hi, I have inherited some code which has a subclass of NSATSTypesetter in it, > and in the -willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset: > method it works out whether it needs to put a page break in, and directly > sets the cu

Running event loop while showing non-standard popup

2013-05-20 Thread Steve Mills
None of this code was written by me, so I don't know the reasoning behind the design. We have a popup that shows an NSWindow with an NSBrowser in it. There is a NSPopUpButtonCell subclass that handles the click with trackMouse:inRect:ofView:untilMouseUp:. This trackMouse method calls [NSApp run

Re: Running event loop while showing non-standard popup

2013-05-20 Thread Ken Thomases
On May 20, 2013, at 12:00 PM, Steve Mills wrote: > None of this code was written by me, so I don't know the reasoning behind the > design. We have a popup that shows an NSWindow with an NSBrowser in it. There > is a NSPopUpButtonCell subclass that handles the click with > trackMouse:inRect:ofVi

Re: Widow / Orphan protection in text layout

2013-05-20 Thread Gideon King
Thanks Kyle, This is actually a bit more than inconvenience - it causes my app to be rejected from the app store. It's all very well overriding -currentTextContainer and returning my ivar, but I have no way of knowing if it is used in different parts of the typesetter, so could be inadvertentl

Re: Running event loop while showing non-standard popup

2013-05-20 Thread Steve Mills
On May 20, 2013, at 13:19:51, Ken Thomases wrote: > -[NSApplication runModalForWindow:] and either one of the -stopModalā€¦ or > -abortModal methods. To detect a click outside of the browser window, you > may need to add a local event monitor (+[NSEvent > addLocalMonitorForEventsMatchingMask:ha