Re: deny file-read-data after launch

2015-01-08 Thread Steve Mills
On Jan 8, 2015, at 17:18:21, Kyle Sluder wrote: > > Make sure you’re not just storing a plain path in NSUserDefaults. To maintain > access to a resource across app launches, you need to use a security-scoped > bookmark. This is an NSData that is created from an NSURL via > -bookmarkDataWithOpt

Re: Am I Reinventing the Wheel? (Part I)

2015-01-08 Thread Charles Jenkins
Jens is right, and I was quite mistaken. The disaster wasn’t a problem with XMLParser’s deserialization at all. When writing out my paragraphs, I create one node for each and put the full paragraph text in. My mistake was believing XMLParser would operate the same way, reading the full text

Re: NSURL resourceValuesForKeys NSURLPathKey

2015-01-08 Thread Sean McBride
On Thu, 8 Jan 2015 16:31:18 -0800, Trygve Inda said: >I call: > >NSData* bookmarkData = [url >bookmarkDataWithOptions:NSURLBookmarkCreationMinimalBookmark >includingResourceValuesForKeys:nil >relativeToURL:nil >error:&inError]; > >And later: > >NSDictionary* dict = [NSURL resourceValuesForKeys:[NS

[MODERATOR] End of Thread: Re: Blurry is the New Sharp

2015-01-08 Thread Chris Hanson
Please stick to technical discussion on cocoa-dev. If there are remaining technical questions in this thread, please ask them in their own threads. (And avoid off-topic derails.) Thanks. -- Chris (cocoa-dev co-mod) ___ Cocoa-dev mailing list (Coc

Re: NSURL resourceValuesForKeys NSURLPathKey

2015-01-08 Thread Ken Thomases
On Jan 8, 2015, at 6:31 PM, Trygve Inda wrote: > I call: > > NSData* bookmarkData = [url > bookmarkDataWithOptions:NSURLBookmarkCreationMinimalBookmark > includingResourceValuesForKeys:nil > relativeToURL:nil > error:&inError]; > > And later: > > NSDictionary* dict = [NSURL resourceValuesForKe

NSURL resourceValuesForKeys NSURLPathKey

2015-01-08 Thread Trygve Inda
I call: NSData* bookmarkData = [url bookmarkDataWithOptions:NSURLBookmarkCreationMinimalBookmark includingResourceValuesForKeys:nil relativeToURL:nil error:&inError]; And later: NSDictionary* dict = [NSURL resourceValuesForKeys:[NSArray arrayWithObject:NSURLPathKey] fromBookmarkData:[self bookma

Re: Machine sleep & wake notifications in a daemon

2015-01-08 Thread Andrew Keller
On Jan 8, 2015, at 6:11 PM, Greg Parker wrote: > On Jan 8, 2015, at 2:54 PM, Andrew Keller wrote: > >> On Jan 8, 2015, at 5:20 PM, Ken Thomases wrote: >> >>> On Jan 8, 2015, at 4:03 PM, Andrew Keller wrote: >>> I would like to receive machine sleep and wake notifications in my daemon.

Re: Machine sleep & wake notifications in a daemon

2015-01-08 Thread Ken Thomases
On Jan 8, 2015, at 4:54 PM, Andrew Keller wrote: > On Jan 8, 2015, at 5:20 PM, Ken Thomases wrote: > >> On Jan 8, 2015, at 4:03 PM, Andrew Keller wrote: >> >>> > > Yes. It looks very promising, but on the first try, I wasn't ab

Re: deny file-read-data after launch

2015-01-08 Thread Kyle Sluder
On Jan 8, 2015, at 2:51 PM, Steve Mills wrote: > > I'm having a problem with my app on 10.9 that I'm not sure about. The user > chooses a folder via NSPathControl, then I use that to do an NSMetadataQuery > for all images inside that folder. I don't have code signing turned on for > this app y

Re: deny file-read-data after launch

2015-01-08 Thread Graham Cox
> On 9 Jan 2015, at 9:51 am, Steve Mills wrote: > > I'm having a problem with my app on 10.9 that I'm not sure about. The user > chooses a folder via NSPathControl, then I use that to do an NSMetadataQuery > for all images inside that folder. I don't have code signing turned on for > this app

Re: Machine sleep & wake notifications in a daemon

2015-01-08 Thread Greg Parker
On Jan 8, 2015, at 2:54 PM, Andrew Keller wrote: > On Jan 8, 2015, at 5:20 PM, Ken Thomases wrote: > >> On Jan 8, 2015, at 4:03 PM, Andrew Keller wrote: >> >>> I would like to receive machine sleep and wake notifications in my daemon. >>> In my Cocoa GUI application, I was able to easily f

Re: Machine sleep & wake notifications in a daemon

2015-01-08 Thread Andrew Keller
On Jan 8, 2015, at 5:20 PM, Ken Thomases wrote: > On Jan 8, 2015, at 4:03 PM, Andrew Keller wrote: > >> I would like to receive machine sleep and wake notifications in my daemon. >> In my Cocoa GUI application, I was able to easily follow the sample code >> under Listing 1 on the page >>

deny file-read-data after launch

2015-01-08 Thread Steve Mills
I'm having a problem with my app on 10.9 that I'm not sure about. The user chooses a folder via NSPathControl, then I use that to do an NSMetadataQuery for all images inside that folder. I don't have code signing turned on for this app yet, but I do have the Sandbox capability turned on. (This i

Re: Machine sleep & wake notifications in a daemon

2015-01-08 Thread Ken Thomases
On Jan 8, 2015, at 4:03 PM, Andrew Keller wrote: > I would like to receive machine sleep and wake notifications in my daemon. > In my Cocoa GUI application, I was able to easily follow the sample code > under Listing 1 on the page >

Re: Blurry is the New Sharp

2015-01-08 Thread Greg Parker
> On Jan 7, 2015, at 7:40 PM, Michael Crawford wrote: > > The last time I reported a bug of any sort to anyone, I reported quite > a serious iOS security hole via Radar. > > The Apple engineer who responded quite angrily closed my bug as "works > as expected". He didn't just close the bug - he

Machine sleep & wake notifications in a daemon

2015-01-08 Thread Andrew Keller
Good day, I would like to receive machine sleep and wake notifications in my daemon. In my Cocoa GUI application, I was able to easily follow the sample code under Listing 1 on the page , but when I tried the same approach in my d

Re: Blurry is the New Sharp

2015-01-08 Thread Jeffrey Oleander
On 2015 Jan 05, at 18:38, Graham Cox wrote: People suggested that OS X had jumped the shark with Lion. If so, we're into Jaws VIII vs. Godzilla 3D territory now. They foisted intentionally blurry text on us by 2002, but don't single out the Apple execs and management. It has infected all of

Re: Am I Reinventing the Wheel? (Part I)

2015-01-08 Thread Jens Alfke
> On Jan 8, 2015, at 4:43 AM, Charles Jenkins wrote: > > I'm writing data to XML. When you create a node and set its string contents, > the node will happily accept whatever string you give and allow you to > serialize information XML deserialization cannot then recreate. In my case, > the st

Re: Am I Reinventing the Wheel? (Part I)

2015-01-08 Thread Charles Jenkins
Fantastic! I can't wait to get home and try it! — Charles On Thursday, January 8, 2015 at 11:08, Keary Suska wrote: > NSDictionary *documentAttributes = @{NSDocumentTypeDocumentAttribute: > NSHTMLTextDocumentType}; > NSData *htmlData = [s dataFromRange:NSMakeRange(0, s.length) > document

Re: Displaying a scaling, relative time or date

2015-01-08 Thread Jens Alfke
> On Jan 8, 2015, at 6:43 AM, Gary L. Wade wrote: > > When it comes to any localized date or number formatters, see if ICU supports > it, especially the included version on the earlier OS you need to support. If > not but a later one does, you could just include it in your app. On OS X you ma

Re: Am I Reinventing the Wheel? (Part II)

2015-01-08 Thread Jens Alfke
> On Jan 8, 2015, at 4:43 AM, Charles Jenkins wrote: > > I have two ranges from an NSAttributedString. I want to compare their fonts > and attributes in such a way as to derive a dictonary containing only the > differences. Does a font-and-attribute comparison method already exist? I'm 99% ce

Re: Am I Reinventing the Wheel? (Part I)

2015-01-08 Thread Keary Suska
On Jan 8, 2015, at 5:43 AM, Charles Jenkins wrote: > I need to deal with two issues that are probably already handled in some > Cocoa API I just haven't found yet. This email asks about the first of these > issues. > > I'm writing data to XML. When you create a node and set its string conten

Re: Am I Reinventing the Wheel? (Part I)

2015-01-08 Thread Greg Weston
Aandi Inston wrote: > (This is in addition to the five characters prohibited in strings because > they are XML markup). Minor nit. There are only 2 prohibited characters in XML, whether in a string or out. ___ Cocoa-dev mailing list (Cocoa-dev@lists.ap

Re: Displaying a scaling, relative time or date

2015-01-08 Thread Gary L. Wade
When it comes to any localized date or number formatters, see if ICU supports it, especially the included version on the earlier OS you need to support. If not but a later one does, you could just include it in your app. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ > On Jan 7, 20

Re: Am I Reinventing the Wheel? (Part I)

2015-01-08 Thread Michael Crawford
Do you absolutely _require_ the use of Cocoa to process your XML? There are oodles of Open Source XML libraries. I myself have had great success with Xerces-C (actually C+). Michael David Crawford, Consulting Software Engineer mdcrawf...@gmail.com http://www.warplife.com/mdc/ Available for So

Re: Am I Reinventing the Wheel? (Part I)

2015-01-08 Thread Aandi Inston
I am not familiar with the API you are using, I use my own XML generator/parser, but it may be worth nothing something about XML. XML files are implicitly Unicode and generally UTF-8. So you cannot put an arbitrary sequence of bytes into XML as a string. A curly quote is not in the low Latin (<=127

Re: Saving NSAttributedString to a File

2015-01-08 Thread Charles Jenkins
Jeffrey, FWIW, I started with RTF and then decided I'd need to switch over to using XML instead in order to have control of writing out what I needed from my NSAttributedStrings. If you're writing RTF for interoperation with another program, you may be stuck with it; but if you're working on yo

Am I Reinventing the Wheel? (Part II)

2015-01-08 Thread Charles Jenkins
This is the second issue for which I'm looking for an existing API call. I have two ranges from an NSAttributedString. I want to compare their fonts and attributes in such a way as to derive a dictonary containing only the differences. Does a font-and-attribute comparison method already exist?

Am I Reinventing the Wheel? (Part I)

2015-01-08 Thread Charles Jenkins
"When you try to reinvent the wheel, most often what you end up with is a flat tire." I need to deal with two issues that are probably already handled in some Cocoa API I just haven't found yet. This email asks about the first of these issues. I'm writing data to XML. When you create a node a

Re: NSScrollView autolayout (10.10)

2015-01-08 Thread Roland King
> On 8 Jan 2015, at 00:57, Ken Thomases wrote: > >> More generally, is this how you’re supposed to set up a view which has >> intrinsic content size inside a scroll view in IB, pin that view to the >> NSView IB gives you, then pin that to the clipview on 3 sides only and flip >> the clip (why