Re: boundingRectForGlyphRange is very inaccurate

2017-03-07 Thread Gerriet M. Denkmann
> On 8 Mar 2017, at 06:37, Ken Thomases wrote: > > On Mar 7, 2017, at 4:17 AM, Gerriet M. Denkmann wrote: >> >> On 6 Mar 2017, at 23:26, Ken Thomases wrote: >>> >>> Try using >>>

Re: boundingRectForGlyphRange is very inaccurate

2017-03-07 Thread Ken Thomases
On Mar 7, 2017, at 4:17 AM, Gerriet M. Denkmann wrote: > > On 6 Mar 2017, at 23:26, Ken Thomases wrote: >> >> Try using >> -enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer:usingBlock:. >> In particular, if you want

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-07 Thread davelist
> On Mar 7, 2017, at 1:19 PM, Alastair Houghton > wrote: > > On 7 Mar 2017, at 12:47, Jean-Daniel wrote: >> >> Did you try to use NSString -fileSystemRepresentation instead of UTF-8, or >> even better, use URL. While using UTF-8 for path

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-07 Thread Alastair Houghton
On 7 Mar 2017, at 12:47, Jean-Daniel wrote: > > Did you try to use NSString -fileSystemRepresentation instead of UTF-8, or > even better, use URL. While using UTF-8 for path worked well on HFS+, It was > never guaranteed to work on all FS. FWIW, the macOS kernel does use

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-07 Thread Alastair Houghton
On 7 Mar 2017, at 18:00, Jens Alfke wrote: > > On Mar 7, 2017, at 8:13 AM, davel...@mac.com wrote: >> >> NSFileManager *fm = [[NSFileManager alloc] init]; >> const char *data = [name fileSystemRepresentation]; >> NSString *filename = [fm

Re: why use extern "C"

2017-03-07 Thread Jens Alfke
> On Mar 7, 2017, at 8:45 AM, bigpig wrote: > > if there is C++ compiler and use C linkage,but if there isn’t C++ compiler > then use what? Then it’s a C compiler, which obviously uses C linkage. > And what is the reason of using this way in code? To make sure that the

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-07 Thread Jens Alfke
> On Mar 7, 2017, at 8:13 AM, davel...@mac.com wrote: > >NSFileManager *fm = [[NSFileManager alloc] init]; >const char *data = [name fileSystemRepresentation]; >NSString *filename = [fm stringWithFileSystemRepresentation:data > length:strlen(data)]; This is a no-op, since you’re

Re: why use extern "C"

2017-03-07 Thread Charles Srstka
> On Mar 7, 2017, at 11:42 AM, Aandi Inston wrote: > > (You should not see // in this section, because in pure C it is forbidden). This is not true with the latest versions of the C standard. Both C99 and C11 support inline // comments. The only case where // is not allowed

Re: why use extern "C"

2017-03-07 Thread Aandi Inston
This is common practice. Here's why. In C++ this #ifdef __cplusplus extern "C" { #endif ………./*some function,struct*/ #ifdef __cplusplus } #endif compiles as extern "C" { ………./*some function,struct*/ } As you identify, this declares C linkage, usually to a precompiled C library, or to make a

why use extern "C"

2017-03-07 Thread bigpig
I see some code like this in iOS project: #ifdef __cplusplus extern "C" { #endif ……….//some function,struct #ifdef __cplusplus } #endif if there is C++ compiler and use C linkage,but if there isn’t C++ compiler then use what? And what is the reason of using this way in code? Thanks!

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-07 Thread davelist
> On Mar 7, 2017, at 9:55 AM, davel...@mac.com wrote: > > >> On Mar 7, 2017, at 7:47 AM, Jean-Daniel wrote: >> >> >>> Le 6 mars 2017 à 14:28, davel...@mac.com a écrit : >>> >>> I have an iOS app (Attendance2) written in Objective-C. One of my users >>> upgraded to the

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-07 Thread davelist
> On Mar 7, 2017, at 7:47 AM, Jean-Daniel wrote: > > >> Le 6 mars 2017 à 14:28, davel...@mac.com a écrit : >> >> I have an iOS app (Attendance2) written in Objective-C. One of my users >> upgraded to the public 10.3 iOS beta and reported he could no longer open >> his

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-07 Thread Jean-Daniel
> Le 6 mars 2017 à 14:28, davel...@mac.com a écrit : > > I have an iOS app (Attendance2) written in Objective-C. One of my users > upgraded to the public 10.3 iOS beta and reported he could no longer open his > documents (I have a subclass of UIManagedDocument so they are Core Data files >

Re: boundingRectForGlyphRange is very inaccurate

2017-03-07 Thread Gerriet M. Denkmann
> On 6 Mar 2017, at 23:26, Ken Thomases wrote: > > On Mar 6, 2017, at 3:41 AM, Gerriet M. Denkmann wrote: >> >> I am trying to get bounding rects in a TextView: >> >> NSRange glyphRange = [ layoutManager glyphRangeForCharacterRange: >>