Re: printing black

2019-01-22 Thread Alastair Houghton
On 22 Jan 2019, at 08:16, Georg Seifert wrote: > > Hi > > I have a app that can print black shapes (using normal cocoa view based > printing). A lot users complain that the printouts are not really black (the > printouts are rastered, so the color sync tries to simulate a CMJK black but >

Re: NSImage to JPEG file?

2019-01-17 Thread Alastair Houghton
On 16 Jan 2019, at 20:17, Jens Alfke wrote: > >> On Jan 16, 2019, at 9:59 AM, Carl Hoefs >> wrote: >> >> But all of that would come "for free" if NSImage inherited from NSData, no? > > Well, that wouldn’t make sense, because an NSImage isn’t a piece of data. It > can have multiple data

Re: Custom NSButton image effects for pressed/disabled

2018-12-13 Thread Alastair Houghton
On 12 Dec 2018, at 01:03, Lars C. Hassing wrote: > > If I assign an image to an NSButton it is displayed with nice pressed and > disabled effects. > > In my custom NSButton, that should display image1+title+image2, I override > drawRect:, but how do I obtain the EXACT SAME system effects for

Re: XPC Question

2018-09-18 Thread Alastair Houghton
On 18 Sep 2018, at 16:48, Sandor Szatmari wrote: > > Thanks Alistair! > > Anyone else have additional info? Well, Cocoa has Distributed Objects, which you could use for this purpose. DO has some interesting behaviour (in particular, watch out - it can throw exceptions, even when calling

Re: touchesMoved value setting

2018-09-18 Thread Alastair Houghton
> On 18 Sep 2018, at 13:44, Eric E. Dolecki wrote: > > I have a UI control that can be adjusted up and down using touch & drag. > I've been asked to provide a control value based on how far the drag is via > distance. So far so good. > > What my designer wants is a value change of every 20

Re: XPC Question

2018-09-18 Thread Alastair Houghton
On 18 Sep 2018, at 13:37, Sandor Szatmari wrote: > > Can you do XPC RPC over an IP connection? Or, in other words… Can you do XPC > between two computers? Not as far as I’m aware. As far as I know, XPC is built on top of Mach messaging, which in theory can be used across the network but IIRC

Re: keyboard focus handling in custom controls

2018-09-10 Thread Alastair Houghton
On 10 Sep 2018, at 13:21, iain wrote: > > I have an application, which has 3 controls > > [button] [custom view] [button] > > I’ve set the NextKeyView of each of them to the control to the right > [button] -> [custom view] -> [button] > > And the tab and shift tab works between them as

Re: C++ pointer to Cocoa object

2018-09-10 Thread Alastair Houghton
On 8 Sep 2018, at 15:32, Casey McDermott wrote: > >>> If you are using ARC and want to get a strong > reference on the object, you have to use __bridge_retained > > That is handy to know! I see there is also __bridge_transfer to go the other > way. IMO the Core Foundation wrappers

Re: How to clear macOS app bundle cache

2018-09-06 Thread Alastair Houghton
On 6 Sep 2018, at 13:59, Andreas Falkenhahn wrote: > > On 06.09.2018 at 11:31 Alastair Houghton wrote: > >> On 6 Sep 2018, at 05:23, Jeff Szuhay wrote: >> Did you try clearing the defaults persistent domain in your code? >> I don’t think that is likely to he

Re: How to clear macOS app bundle cache

2018-09-06 Thread Alastair Houghton
On 6 Sep 2018, at 05:23, Jeff Szuhay wrote: > > Did you try clearing the defaults persistent domain in your code? I don’t think that is likely to help. Andreas was complaining that the code in his bundle was being cached somewhere, so when he rebuilt it didn’t always load the new version.

Re: How to clear macOS app bundle cache

2018-09-05 Thread Alastair Houghton
On 4 Sep 2018, at 19:57, Andreas Falkenhahn wrote: > > On 04.09.2018 at 18:27 Marco S Hyman wrote: > >> Have you tried disabling SMB client side caching? >> https://support.apple.com/en-us/HT207520 > > Doesn't change anything. Maybe because the share is SMB 1, not SMB 2 or 3 as > stated in

Re: How to clear macOS app bundle cache

2018-09-04 Thread Alastair Houghton
On 4 Sep 2018, at 14:30, Shane Stanley wrote: > > On 4 Sep 2018, at 11:28 pm, Alastair Houghton > wrote: >> >> On 4 Sep 2018, at 00:19, Shane Stanley wrote: >>> >>> On 3 Sep 2018, at 11:31 pm, Andreas Falkenhahn >>> wrote: >>>&

Re: How to clear macOS app bundle cache

2018-09-04 Thread Alastair Houghton
On 4 Sep 2018, at 00:19, Shane Stanley wrote: > > On 3 Sep 2018, at 11:31 pm, Andreas Falkenhahn wrote: >> >> I'm looking for a solution to flush the app bundle cache > > If you find one, I'd love to know what it is. I had no luck at all. Is the application in question sandboxed? If so, have

Re: Carbon -> Cocoa

2018-08-24 Thread Alastair Houghton
On 24 Aug 2018, at 20:01, Tor Arne Vestbø wrote: > > On 23 Aug 2018, at 12:06, Alastair Houghton > wrote: >> >> Run loops are based on dispatch queues too, these days. > > Are they? We use CFRunLoop in the Qt event dispatchers on macOS and iOS, and > I these be

Re: Carbon -> Cocoa

2018-08-23 Thread Alastair Houghton
On 22 Aug 2018, at 21:42, Saagar Jha wrote: > >> Are they? kqueue() supports monitoring of fds, Mach ports and timers, so >> there’s really no reason that CFRunLoop would have to spawn a background >> thread just to monitor some file descriptors. As far as I can tell, the >> current

Re: Carbon -> Cocoa

2018-08-23 Thread Alastair Houghton
On 22 Aug 2018, at 19:32, Jens Alfke wrote: > >> On Aug 22, 2018, at 10:40 AM, Alastair Houghton >> mailto:alast...@alastairs-place.net>> wrote: >> >> Well, yes and no. If the network library works that way, it’ll fire its >> callbacks on the back

Re: Carbon -> Cocoa

2018-08-22 Thread Alastair Houghton
On 22 Aug 2018, at 17:53, Jens Alfke wrote: > >> On Aug 21, 2018, at 8:33 AM, Alastair Houghton > <mailto:alast...@alastairs-place.net>> wrote: >> >> So, for instance, it’s not so good on macOS or iOS if its event dispatcher >> is based on select(),

Re: Carbon -> Cocoa

2018-08-21 Thread Alastair Houghton
On 21 Aug 2018, at 10:09, Mike Crawford wrote: > >> drag C developers away from the POSIX sockets API > > Don't be dismayed if you're not happy with NIO: > > There are numerous APIs that do such dragging, for example the > ADAPTIVE Communications Environment (ACE): > >

Re: Carbon -> Cocoa

2018-08-20 Thread Alastair Houghton
On 20 Aug 2018, at 14:27, Casey McDermott wrote: > > Moving anything from Obj-C to C++ objects is easy, because the .mm file can > contain both. > > Moving back is hard, because C++ can't reference Obj-C classes. It can, but only if it’s either (a) in a .mm file, or (b) prepared to call the

Re: Carbon -> Cocoa

2018-08-20 Thread Alastair Houghton
On 18 Aug 2018, at 20:45, Mike Crawford wrote: > > "older OS versions", porting to 10.6 or later vs. 10.10 or later: > > I at first intended all the drivers I write for my clients to work on > Snow Leopard 10.6, but after actually attempting to do so I settled > upon supporting El Capitan

Re: Carbon -> Cocoa

2018-08-20 Thread Alastair Houghton
On 17 Aug 2018, at 17:45, Casey McDermott wrote: > >>> By now, Cocoa may be the new Carbon. if your app is large, I'd wait to >>> see what happens with Marzipan. > > This is true, and very scary. Makes us wonder about sunk cost fallacy. I don’t actually think it’s very likely that Marzipan

Re: NSComboBox

2018-07-26 Thread Alastair Houghton
On 26 Jul 2018, at 01:18, Casey McDermott wrote: > > We have a 1/2 decent version working right now based on NSTextField. It shows > a scrolling table > with a NSWindowController, and selects from the table (and beeps if not > there). It also > has a NSPopUpButton on the side to use as an

Re: NSDrawer

2018-07-03 Thread Alastair Houghton
On 3 Jul 2018, at 03:08, Casey McDermott wrote: > > NSDrawer is deprecated, but it's also perfect for our application. > We still haven't found a good substitute. [snip] > Is there a work-around for an attached window that pops out on the side, > and acts like a drawer? NSDrawer isn’t

Re: Scrolling differences when using Trackpad or Mouse-Wheel

2018-06-20 Thread Alastair Houghton
On Jun 19, 2018, at 2:56 AM, Michael Starke mailto:michael.sta...@hicknhack-software.com>> wrote: > > Hi list, > > I'm currently trying to find the bottleneck in my app MacPass that's causing > the scrolling in the main table to be sluggish. > > Before diving deeply into Instruments to find

Re: Exception handling

2018-06-16 Thread Alastair Houghton
On 15 Jun 2018, at 19:30, Jens Alfke wrote: > >> On Jun 14, 2018, at 5:58 PM, Quincey Morris >> wrote: >> >> as someone already mentioned, NSExceptions can’t successfully cross >> dylib/framework boundaries. > > They can, actually; there is no problem with this at the ABI/runtime level. >

Re: Exception handling

2018-06-14 Thread Alastair Houghton
On 14 Jun 2018, at 18:00, Jens Alfke wrote: > >> On Jun 13, 2018, at 7:22 PM, Casey McDermott wrote: >> >> Our Carbon event loop had a try/catch block, which caught most exceptions, >> and then >> continued. It started as an expedient in early production, but it remained >> in production

Re: Exception handling

2018-06-14 Thread Alastair Houghton
On 14 Jun 2018, at 03:53, Quincey Morris wrote: > > On Jun 13, 2018, at 19:22 , Casey McDermott wrote: >> >> Nearly always, the event loop is the best place to escape to. > > This is not how current thinking goes, unless you mean something different > from what I think you’re saying.

Re: Crashes inside CFStringDeallocate

2018-06-11 Thread Alastair Houghton
On 10 Jun 2018, at 19:14, Dave wrote: > > Override the dealloc method and log when its called - its probably being > over-released! That isn’t quite as simple as it sounds, because this is NSString we’re talking about, which is a class cluster. Most actual NSString instances are really

Re: Crashes inside CFStringDeallocate

2018-05-29 Thread Alastair Houghton
On 25 May 2018, at 22:18, Vojtěch Meluzín wrote: > > Ok so I got a solution - it's the utf16 indeed. When I use [NSString > stringWithUTF8String] instead, it doesn't crash. Considering it does that > only on 10.10 (and probably older), it seems like OSX malfunction... oh > well... Fortunately no

Re: Implementing an import command in NSDocument-based app

2018-05-16 Thread Alastair Houghton
On 16 May 2018, at 08:55, Pascal Bourguignon wrote: >> Le 16 mai 2018 à 09:26, Rick Mann a écrit : >> >> I'm working on a little NSDocument-based app. The documents are packages (a >> directory containing multiple files). One of the operations is

Re: Avoiding link conflicts with a static library

2018-04-04 Thread Alastair Houghton
On 4 Apr 2018, at 17:25, Redler Eyal wrote: > > We're developing an SDK for iOS, the SDK is delivered in a statically-linked > framework. Our library uses openCV and we link OpenCV into the delivered > framework binary. > > This SDK was deployed successfully with some

Re: Creating NSTableView programmatically

2017-12-11 Thread Alastair Houghton
On 11 Dec 2017, at 13:53, Eric Matecki wrote: > > Thanks Jonathan, > > I got a lot further now. > So it is NSTableCellView, not NSTableViewCell as stated in the doc ! FWIW, NSTableViewCell is the old way to do it, before view-based tables were the norm, which probably

Re: NSString equivalent of CFSTR macro?

2017-12-05 Thread Alastair Houghton
On 4 Dec 2017, at 22:47, Rick Mann wrote: > > I have to use some C header file that #defines some string constants. Is > there an equivalent to CFSTR() that constructs NSString literals? E.g., > > > #define NSSTR(s) (@ ## s) <-- magic; this

Re: Inserting a button into another application's toolbar

2017-09-19 Thread Alastair Houghton
> On 19 Sep 2017, at 06:01, Jack Brindle wrote: > > Actually, there may be a way. It all depends on exactly where in the menu bar > you want to place the menu item. I think the OP wanted to inject a *toolbar* item into another app’s window’s toolbar, not a menu bar

Re: Is "-init" really needed?

2017-08-10 Thread Alastair Houghton
On 10 Aug 2017, at 15:24, Jeremy Hughes <moon.rab...@virginmedia.com> wrote: > >> On 10 Aug 2017, at 15:15, Alastair Houghton <alast...@alastairs-place.net> >> wrote: >> >> On 10 Aug 2017, at 15:09, Charles Srstka <cocoa...@charlessoft.com> wro

Re: Is "-init" really needed?

2017-08-10 Thread Alastair Houghton
On 10 Aug 2017, at 15:09, Charles Srstka wrote: > > They’re equivalent syntactically, but performance-wise, +array and friends > will cause the object to be put into an autorelease pool. Therefore, +new is > better for performance. Not with ARC they don’t. The ARC

Re: Is "-init" really needed?

2017-08-10 Thread Alastair Houghton
On 10 Aug 2017, at 14:57, gerti-cocoa...@bitart.com wrote: > > On Aug 10, 2017, at 02:18, Alastair Houghton <alast...@alastairs-place.net> > wrote: >> >> Personally I *would* still discourage +new in favour of class-specific >> convenience constructors bec

Re: Is "-init" really needed?

2017-08-10 Thread Alastair Houghton
On 10 Aug 2017, at 00:28, Doug Hill wrote: > >> - Performance - it incurs an extra message send (which would have been an >> issue back in the day) > > +new requires no extra message. It's just a shorthand for [[SomeClassname > alloc] init] Er, yes it does. It sends a

Re: Is "-init" really needed?

2017-08-09 Thread Alastair Houghton
On 8 Aug 2017, at 17:38, Doug Hill wrote: > > As others have mentioned, I too have never seen any evidence or statements > from Apple that discourages +new or -init. I suspect it was ObjC programmers themselves rather than Apple/NeXT that discouraged it. As for why, well

Re: Best practice with NSProgressIndicator

2017-07-28 Thread Alastair Houghton
On 28 Jul 2017, at 16:57, Mark Allan wrote: > > I'm wondering if anyone has any thoughts about or links to best practices > when using determinate NSProgressIndicators. [snip] > I'm debating doing it with an NSTimer firing every second, but wondered if > anyone had any

Re: Who owns a child view controller?

2017-07-14 Thread Alastair Houghton
On 14 Jul 2017, at 12:03, Jeremy Hughes wrote: > >> On 13 Jul 2017, at 20:29, Alex Zavatone wrote: >> >> One thing that I had to learn was to break my expectations of when a view >> controller (one that is tied to a navigationController) is

Re: Increasing stack size of NSDocument's open file thread

2017-07-06 Thread Alastair Houghton
On 6 Jul 2017, at 16:33, Graham Cox wrote: > > I appreciate your answer, and I realise there’s no API that could set the > stack size after the thread is created. > > But presumably the stack size of the thread is set somewhere as a parameter > to the thread when it’s

Re: Increasing stack size of NSDocument's open file thread

2017-07-06 Thread Alastair Houghton
On 6 Jul 2017, at 06:57, Graham Cox wrote: > > I’m wondering if there’s a way to increase the stack size of the thread that > opens my NSDocument in the background. There’s no way an API could exist that did that - in general it’d have to copy the entire existing stack

Re: Is cloning the same as copying in APFS?

2017-06-28 Thread Alastair Houghton
On 27 Jun 2017, at 22:45, Rick Mann wrote: > > Agreed. Thanks for the code, and for showing the other techniques. In my > case, I still have to support HFS+, and I want to do that with hard links. I > wish there was an API to clone-or-hardlink, but I can do that.

Re: Is cloning the same as copying in APFS?

2017-06-27 Thread Alastair Houghton
On 27 Jun 2017, at 06:28, Jens Alfke wrote: > >> On Jun 26, 2017, at 7:38 PM, Rick Mann wrote: >> >> But there's actually a POSIX "clone" API, and so I wonder if a copy is >> different from a clone. > > The low level file copying API that I’m aware

Re: file encription/decriptoin iOS

2017-06-27 Thread Alastair Houghton
On 27 Jun 2017, at 03:25, Sandor Szatmari wrote: > > This is an interesting thread. The OP's original question made me think of > the functionality Apple recently (how recently I'm not sure) added to the iOS > Notes app. It allows you to selectively 'encrypt'

Re: file encription/decriptoin iOS

2017-06-26 Thread Alastair Houghton
On 24 Jun 2017, at 21:12, yu...@aim.com wrote: > > I hope i am at the right place to ask for help on file encryption/decryption > for iOS. > > I need to encrypt a pdf file during download and to decrypt it for display > later on. Can i get some pointers about implementing the >

Re: How to create an animated gif?

2017-06-21 Thread Alastair Houghton
On 21 Jun 2017, at 16:09, Jens Alfke wrote: > > On Jun 20, 2017, at 11:17 PM, Gerriet M. Denkmann wrote: >> >> Assume that I have two NSImages, both with the same size, how can I create >> an animated gif which alternates between these two images? > >

Re: NSTimer or what?

2017-06-20 Thread Alastair Houghton
On 20 Jun 2017, at 04:04, Gerriet M. Denkmann wrote: > > macOS 11+ > > Some Cocoa app which has to do: > 1. something a few seconds later The main issue here isn’t energy use so much as whether you want to be able to cancel the operation. If you need to be able to cancel

Re: Repository of older (outdated) PDF Guides?

2017-05-19 Thread Alastair Houghton
On 19 May 2017, at 15:17, Richard Charles wrote: > >> Honestly. The fact that Apple now actively prevents us from having access to >> such lovely, useful, EASY TO UNDERSTAND AND SEARCH documents like these is >> just so disappointing. > > Very well said. The sad part

Re: Does file-mapping a memory allocation work around RAM limits?

2017-05-04 Thread Alastair Houghton
To answer the OP’s original question, I’m not sure about the exact rules Apple is using on iOS, but I’d expect the memory limit to apply to *private* memory, namely that allocated using malloc() et al, plus dirty pages mapped with mmap()’s MAP_PRIVATE flag. Read-only and shared mappings that

Re: Current, preferred way to add help to your Mac app?

2017-04-10 Thread Alastair Houghton
On 9 Apr 2017, at 23:00, Richard Charles <rcharles...@gmail.com> wrote: > >> On Apr 9, 2017, at 11:55 AM, Alastair Houghton >> <alast...@alastairs-place.net> wrote: >> >> The documentation isn’t exactly great (at least, the last time I had to use >&g

Re: Current, preferred way to add help to your Mac app?

2017-04-09 Thread Alastair Houghton
On 9 Apr 2017, at 10:31, J.E. Schotsman wrote: > > On 08 Apr 2017, at 21:00,Jeff Szuhay wrote: > >> Nevermind. I found the “Apple Help Programming Guide.” > > Good luck. That’s a weird mix of obsolete and newer API descriptions. The > newer ones don’t work for me. >

Re: disable group of controls

2017-04-05 Thread Alastair Houghton
On 5 Apr 2017, at 12:05, J.E. Schotsman wrote: > >> On 05 Apr 2017, at 11:48, Jack Carbaugh wrote: >> >> Get a list of the controls then loop through it, setting each enabled >> property to false. The container holding them will hold a reference to them >

Re: disable group of controls

2017-04-05 Thread Alastair Houghton
On 5 Apr 2017, at 10:45, J.E. Schotsman wrote: > > On 03 Apr 2017, at 21:00, J.E. Schotsman wrote: >> >> What is the Cocoa way of enabling/disabling a group of controls? >> In Carbon I used to use a user pane for that. >> I thought I would try an NSBox but then I realized it

Re: Normalisation of filenames

2017-04-05 Thread Alastair Houghton
On 5 Apr 2017, at 09:09, Jean-Daniel wrote: > >> Le 5 avr. 2017 à 07:49, Gerriet M. Denkmann a écrit : >> >> Apple uses (as far as I remember) a variant of Unicode’s canonical >> decomposition form. > > Yes they do. I think is due to lack of

Re: Can't use +initialize, now what?

2017-03-30 Thread Alastair Houghton
On 29 Mar 2017, at 21:17, Jens Alfke wrote: > >> On Mar 29, 2017, at 10:52 AM, Quincey Morris >> wrote: >> >> If willFinishLaunching is not early enough, then you can put code in your >> “main” function, but I don’t know how feasible

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-23 Thread Alastair Houghton
On 23 Mar 2017, at 17:57, Ed Wynne wrote: > >> Shouldn’t the VFS layer actually be doing this? It is part of its whole >> raison d’être, no? Just have -[NSURL fileSystemRepresentation] normalize >> things according to the correct Unicode rules, and let the VFS layer >>

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-23 Thread Alastair Houghton
On 22 Mar 2017, at 18:00, David Duncan wrote: > > So there was another explanation posted on the bug that I’m not certain you > got, but which I think may explain. > > Basically the concept is that since APFS doesn’t normalize file names, if you > store file names in

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-23 Thread Alastair Houghton
On 22 Mar 2017, at 19:13, Chris Ridd <chrisr...@mac.com> wrote: > >> On 22 Mar 2017, at 09:05, Alastair Houghton <alast...@alastairs-place.net> >> wrote: >> >> In the context of filesystems (and specifically filenames), the phrases “bag >> of bytes

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-22 Thread Alastair Houghton
On 21 Mar 2017, at 20:49, Quincey Morris wrote: > > On Mar 20, 2017, at 14:23 , davel...@mac.com wrote: >> >> "iOS HFS Normalized UNICODE names , APFS now treats all file[ name]s as a >> bag of bytes on iOS . We are requesting that Applications developers

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-21 Thread Alastair Houghton
On 21 Mar 2017, at 12:33, Jean-Daniel wrote: > > This is what the reply suggest but that make no sens for me. If you are > accessing the file using URL, that the work of the framework to convert the > URL into the right file system representation. Agreed, IMO the

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: Sometimes all my menus are disabled

2017-02-14 Thread Alastair Houghton
On 14 Feb 2017, at 22:15, Graham Cox wrote: > >> On 15 Feb 2017, at 12:39 AM, Andreas Falkenhahn >> wrote: >> >> I knew how to use IB on the old PowerPC Mac, >> but that was 10 years ago. > > Well, it hasn’t changed that much in principle. In

Re: setFontManagerFactory:

2017-01-27 Thread Alastair Houghton
On 26 Jan 2017, at 19:06, Raglan T. Tiger wrote: > > According to the docs if one does: > > [ NSFontManager setFontManagerFactory:[ EFontManager class ] ]; > > before the main nib file is loaded and where EFontManager is a subclass of > NSFontManager and

Re: On NSIncrementalStore UUID Uniqueness

2017-01-16 Thread Alastair Houghton
On 14 Jan 2017, at 10:41, Daryle Walker wrote: > > Could I base the UUID off a hash of the URL? Maybe, but it wouldn’t survive > file moves. There are file references in macOS, which would be more stable, > but I read that there’s a bug in the URL class where it would degrade

Re: NSNetServiceBrowser vs. mDNSResponder

2017-01-13 Thread Alastair Houghton
On 13 Jan 2017, at 09:40, Gerriet M. Denkmann wrote: > > iOS (10.2) app does: > > SERVICE_TYPE = 1 to 63 ascii chars; no spaces; no ‘.’; no ‘[‘; can use ‘_' > or '-'; case insensitive > Note: I did not find these rules documented anywhere, they are just the > result of

Re: On NSIncrementalStore UUID Uniqueness

2017-01-11 Thread Alastair Houghton
On 11 Jan 2017, at 00:16, Saagar Jha wrote: > > Small quibble: UUIDs are not guaranteed to be unique. It's just extremely > likely they will be, and they be sufficient for almost all applications, > including this one. If we’re going to be pedantic, properly issued

Re: Requires High Performance Graphic Card - Why?

2016-12-15 Thread Alastair Houghton
On 16 Dec 2016, at 04:11, Gerriet M. Denkmann wrote: > > macOS 12.2; MacBook Pro (Retina, Mid 2012). > > Activity Monitor → Energy tells me that my app requires a "High Performance > Graphic Card”. > > The problem: it has absolutely no reason to do so. > The app does some

Re: Large "Data" support

2016-12-06 Thread Alastair Houghton
On 6 Dec 2016, at 01:15, Jens Alfke wrote: > >> On Dec 5, 2016, at 4:12 PM, Daryle Walker wrote: >> >> For the Swift 3 "Data" type, if I want to represent a multi-gigabyte file, >> it won't try to do it all in memory, would it? > > The Data type

Re: Vertically Centered Colon

2016-12-01 Thread Alastair Houghton
On 1 Dec 2016, at 19:05, Doug Hill wrote: > > Just made another breakthrough. I finally figured out why we have the > vertically centerd colon (I’ll now call it VCC) by default but has > requirements of numbers on either side of the colon. > The SF font setting is

Re: Vertically Centered Colon

2016-12-01 Thread Alastair Houghton
On 1 Dec 2016, at 15:57, Alex Zavatone wrote: > > If we are able to do it right, then we don't have to worry about waiting for > it or aren't put behind an 8 ball if Apple decides to pull the rug out from > under us if it decides to change the feature (which happens). > > With

Re: Vertically Centered Colon

2016-12-01 Thread Alastair Houghton
On 30 Nov 2016, at 18:33, Doug Hill wrote: > >> On Nov 29, 2016, at 11:06 PM, Alex Zavatone wrote: >> >> On Nov 30, 2016, at 12:10 AM, Doug Hill wrote: >> >>> After some trial and error, I figured out how to accomplish the San >>> Francisco font features

Re: Vertically Centered Colon

2016-11-28 Thread Alastair Houghton
On 28 Nov 2016, at 16:18, Gerriet M. Denkmann wrote: > > >> On 28 Nov 2016, at 22:13, Eric E. Dolecki wrote: >> >> You could probably use an attributed string and add an attribute for the >> last colon: NSBaselineOffsetAttributeName > > Yes; but this

Re: Fonts in TableView

2016-11-07 Thread Alastair Houghton
On 6 Nov 2016, at 06:18, Quincey Morris wrote: > > 5. It’s rather indeterminate what glyphs the bounding box should reflect. In > particular, in digital typography using Unicode characters, a font as > perceived by the user may be a composite of multiple

Re: Prioritizing drawing of the important stuff

2016-10-31 Thread Alastair Houghton
On 29 Oct 2016, at 10:37, Jonathan Taylor wrote: > > This is a bit of a general question, but hopefully people may have some > suggestions. I've got some drawing code that synthesizes an image in a > window, which will change in response to sliders (e.g. changing

Re: How to count Atoms

2016-10-07 Thread Alastair Houghton
On 7 Oct 2016, at 08:19, Gerriet M. Denkmann wrote: > So what is the proper way to count something atomicly and undeprecatedly? or is the approved source for this kind of thing. In C++, you might write #include std::atomic counter; then you can just do

Re: Where are the ICU Headers?

2016-10-06 Thread Alastair Houghton
On 6 Oct 2016, at 10:43, dangerwillrobinsondan...@gmail.com wrote: > > Pretty sure the reason is a simple one. > If you look at the history of open source in the OS on the Apple open source > page, you'll notice they pretty much bump the ICU version they use annually. > Although unlikely, ICU

Re: Stupid objective-c question

2016-09-27 Thread Alastair Houghton
On 27 Sep 2016, at 05:31, Britt Durbrow wrote: > > FWIW, it’s currently an implementation detail that SELs do map into the > global address space in a way that doesn’t collide with anything else; but > technically, they are in their own address space and

Re: Stupid objective-c question

2016-09-27 Thread Alastair Houghton
On 27 Sep 2016, at 02:17, Slipp Douglas Thompson wrote: > > I'm just going to throw this out there as a solution, not because I recommend > this approach (it's API misuse after all) but because it would work. > > Instead of using an `NSString *` you could use a

Re: Stupid objective-c question

2016-09-23 Thread Alastair Houghton
On 23 Sep 2016, at 10:04, Quincey Morris wrote: > >> static void* kMyContext = > > That makes the “&” optional (at comparison time), and it should even avoid > the coalescing problem if it’s declared const. Yes, that’s a good way to do it. It might be a

Re: Stupid objective-c question

2016-09-23 Thread Alastair Houghton
On 23 Sep 2016, at 09:36, Alastair Houghton <alast...@alastairs-place.net> wrote: > > Note that you can use *any* type for your variable; in some ways, it might > make sense to use a non-pointer type, just to make clear that it’s the > address that matters, e.g. >

Re: Stupid objective-c question

2016-09-23 Thread Alastair Houghton
On 23 Sep 2016, at 00:07, Quincey Morris wrote: > > On Sep 22, 2016, at 15:45 , Gabriel Zachmann wrote: >> >> Sure, but an observation method is what would be called a "callback" in >> plain C. >> In C, I can have many different

Re: Stupid objective-c question

2016-09-23 Thread Alastair Houghton
On 23 Sep 2016, at 00:19, Sandor Szatmari wrote: > > I wanted to get some opinions on the following which I have done in the past > and perceive as different because the string constant is introduced and > defined once and only once. > > // my .m file > static

Re: Normalising file names on macOS

2016-09-22 Thread Alastair Houghton
On 22 Sep 2016, at 16:30, Ken Thomases wrote: > > Without undermining Alastair's recommendations, you can achieve what you want > by round-tripping the string through -[NSString fileSystemRepresentation] and > -[NSFileManager stringWithFileSystemRepresentation:length:].

Re: Normalising file names on macOS

2016-09-22 Thread Alastair Houghton
On 22 Sep 2016, at 12:46, John Brownie wrote: > > OK, the situation is that the user provides a name, which comes in through a > standard text field in a dialog. That name is used as a key for a dictionary > which gives a collection of information about that item. It is

Re: Normalising file names on macOS

2016-09-22 Thread Alastair Houghton
On 22 Sep 2016, at 12:04, John Brownie wrote: > > I find that I am in need of dealing with versions of strings that may be > turned into file names, and thus I need to be comparing normalised forms. > However, according to >

Re: loadNibNamed deprecated, but newer version crashes

2016-09-19 Thread Alastair Houghton
On 19 Sep 2016, at 10:02, Gabriel Zachmann wrote: > > Thanks a lot for your response. > > When I replace this line > [NSBundle loadNibNamed: @"ConfigureSheet" owner: self]; > by this: > NSBundle * bundle = [NSBundle bundleForClass:[self class]]; >

Re: How to make Xcode launch a different app when "Running" my code?

2016-09-19 Thread Alastair Houghton
On 18 Sep 2016, at 14:54, Uli Kusterer wrote: > > On 18 Sep 2016, at 12:02, Gabriel Zachmann wrote: >> When I "Run" my code in Xcode (i.e., hit CMD-R), I would like Xcode to build >> the code, copy the product to its destination, >> and then

Re: Swift and Threads

2016-09-13 Thread Alastair Houghton
On 13 Sep 2016, at 05:29, Jens Alfke wrote: > > The Bool type is one byte in size. > > C++ has a specialization for std::vector that makes it a true bit > array, but I’m not sure if Swift’s generic system is powerful enough to be > able to entirely switch out the

Re: Why doesn't this crash?

2016-09-12 Thread Alastair Houghton
On 10 Sep 2016, at 12:39, Andreas Falkenhahn wrote: > > To open a video, I do the following: > >AVPlayer *p = [[AVPlayer alloc] initWithURL:url]; > > I'd expect this code to crash on 10.6 because 10.6 doesn't have AVPlayer. > To my surprise, however, the code

Re: Progress Indicator

2016-09-12 Thread Alastair Houghton
On 10 Sep 2016, at 15:38, Peter Hudson wrote: > > I have a simple view with a progress indicator in it. > Simple circular type - indeterminate. > > I start it with [progInd startAnimation:self]; > I end it with[progInd stopAnimation:self]; > > After a couple of

Re: Linking against AVKit breaks app on 10.6

2016-09-12 Thread Alastair Houghton
On 10 Sep 2016, at 12:47, Andreas Falkenhahn wrote: > > When I link my app against AVKit using > >-framework AVKit > > it fails to load on 10.6 claiming > >dyld: Library not loaded: > /System/Library/Frameworks/AVKit.framework/Versions/A/AVKit >Referenced

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Alastair Houghton
> On 7 Sep 2016, at 22:11, Jens Alfke <j...@mooseyard.com> wrote: > > >> On Sep 7, 2016, at 10:03 AM, Alastair Houghton >> <alast...@alastairs-place.net> wrote: >> >> All of it can. Objective-C is just C with some syntactic sugar on top. >

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Alastair Houghton
On 7 Sep 2016, at 17:09, Andreas Falkenhahn wrote: > > As a C programmer I'm trying to avoid Objective C whenever and wherever > possible. Don’t. Where there’s an Objective-C equivalent, it’ll be less error prone, shorter to write and easier to debug. > The good

Re: Running apps compiled for newer OS X versions on older versions (rant)

2016-09-05 Thread Alastair Houghton
On 5 Sep 2016, at 13:48, Mark Allan wrote: > > It's probably also worth noting that you *can* compile for 10.6 using the > tools on 10.11 by adjusting the deployment target. This is *usually* but not always true. There are sometimes backwards compatibility problems that

Re: Pixel-perfect migration from ATSUI to Core Text

2016-09-01 Thread Alastair Houghton
On 1 Sep 2016, at 14:38, Andreas Falkenhahn wrote: > > The problem is most likely that the “W” doesn’t start at x = 0 >> (have you tried calling CTLineGetOffsetForStringIndex(line, 0, NULL)?) > > That returns 0, that's why I was using 1. Hmmm. OK, well looking at the

Re: Pixel-perfect migration from ATSUI to Core Text

2016-09-01 Thread Alastair Houghton
On 31 Aug 2016, at 19:24, Andreas Falkenhahn <andr...@falkenhahn.com> wrote: > > On 31.08.2016 at 20:08 Alastair Houghton wrote: > >> On 31 Aug 2016, at 15:52, Andreas Falkenhahn <andr...@falkenhahn.com> wrote: > >>> But I still don't understand h

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-31 Thread Alastair Houghton
On 31 Aug 2016, at 15:52, Andreas Falkenhahn wrote: > > But I still don't understand how computing glyph positioning manually > should work around the fact that there are no APIs that measure the text > like ATSUI. I mean, internally, CTLineGetOffsetForStringIndex()

  1   2   3   4   5   >