Code signing checking

2023-01-06 Thread Aandi Inston via Cocoa-dev
Is there any API for doing the following activities related to code signing? - Check that the signature on the running codesigned executable is from the same company as the signature on a bundle? OR - Get the company from the codesigned running executable and - Get the company from a signature on

Are runtimes of system objects dynamic/SDK dependent/whatever?

2022-06-14 Thread Aandi Inston via Cocoa-dev
I'm trying to understand how Mac OS X actually implements the predefined objects like NSApplication. Not in detail by function, but where the code lives. This is by way of understanding what happens if the SDK version doesn't match the system version. Let's suppose I would like to use an imaginary

Re: Problem with rangeOfString and Umlauts

2022-03-14 Thread Aandi Inston via Cocoa-dev
This is largely from memory, so details might be wrong. Normalisation is an insufficiently known thing to consider when working with Unicode. (We all know that Unicode is a list of code points (integers). Here are some Unicode points for this discussion: U+0065 "e" Latin Small Letter E U+00E9

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-05-22 Thread Aandi Inston via Cocoa-dev
Your report is interesting. I have been following it but may have missed a part of the discussion, so here is one thought I had. You say that getting the display name of ~/Documents may result in a delay. This is localizable, so that in Portugal (for example) the display name is Documentos. So

Re: Not seeing rightMouseDown: - what are the docs actually saying ?

2019-10-21 Thread Aandi Inston via Cocoa-dev
alternative of using rightMouseUp: seems to work well enough on both 16 and 32 bits. So, I'm happy to consider this closed. Thanks again. On Mon, 21 Oct 2019 at 20:17, Richard Charles wrote: > > On Oct 20, 2019, at 8:27 AM, Aandi Inston wrote: > > > > We have a workaround, which is t

Re: Not seeing rightMouseDown: - what are the docs actually saying ?

2019-10-20 Thread Aandi Inston via Cocoa-dev
" Why are you compiling a plugin for 32 bits?" Because plug-ins must match the host app. In this case the host app's 64 bit version was only released 4 years ago. (The host app is made by a third party). Older versions of the app run on 10.14 and are still widely used by our customers. So, while

Not seeing rightMouseDown: - what are the docs actually saying ?

2019-10-18 Thread Aandi Inston via Cocoa-dev
I believe I may be seeing an effect described in the Cocoa docs for the rightMouseDown: method. I am unsure exactly what the docs are saying however. Symptom: compiled for 64-bits, an unhandled rightMouseDown: is eventually sent to the NSWindow subclass, but compiled for 32-bits (and run on

Re: NSScrollView showing part of view with white space above

2019-10-13 Thread Aandi Inston via Cocoa-dev
No auto-layout, identical coordinate systems. I found the solution, which is entirely my fault of course, thanks to your comment "It sounds like your NSView actually has white space at the top." For the benefit of future readers of this thread, here is the solution. I assumed the underlying

NSScrollView showing part of view with white space above

2019-10-13 Thread Aandi Inston via Cocoa-dev
I have having a problem working with NSScrollView. The code is in pieces all over the desk at the moment, but I'm asking in case someone recognises the symptoms, before I reduce this to a simple test case. An NSScrollView is made from an NSView containing various NSControls. The NSView is fine

Re: Thoughts on Cocoa source code

2019-10-09 Thread Aandi Inston via Cocoa-dev
" . Cocoa is part of the OS, and changes one very OS release. " This reminds me of a question which pops up for me every few years in development. I can't call to mind the last specific details, but it will happen again. Let's create an imaginary problem: * Apple add a new class behaviour to

Re: Deep linking from 1 tvOS app to another

2017-06-17 Thread Aandi Inston
> Actually don’t do the substitution by hand. Let NSString URL-encode it for you. Otherwise your URL will break again when someone decides to type a “/“ or “#”, etc. into your text field. This is an interesting point. A / is actually legal in a URL but has specific semantics, while space just

Re: Deep linking from 1 tvOS app to another

2017-06-16 Thread Aandi Inston
Spaces are not legal in a URL. So failure or unpredictable results is expected. See for example discussion here https://stackoverflow.com/questions/497908/is-a-url-allowed-to-contain-a-space On 16 June 2017 at 16:00, Eric E. Dolecki wrote: > I have deep linking working, but

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-21 Thread Aandi Inston
Is the question, what is canonical mapping? I'm going to assume it is, so I can share what I found when I hit much the same issue. This is mostly from memory so let's hope it's right. Take the word Café. How many Unicode characters is this and what are they? Turns out there are two answers. The

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

Re: Mystery Threads

2016-09-29 Thread Aandi Inston
My thoughts are general, not specific to Mac OS... The idea that the best performance comes from threads = #CPUs is attractive, but will work only if the threads do not sleep and do not interfere with each other. A classic example is dividing up a complex calculation that runs without touching the

Re: Emailing from a daemon process

2016-07-07 Thread Aandi Inston
> > Is there a way to fire off a simple email from an ObjC Foundation-only app running in the background "Just" sending email seems like such a simple thing. But remember, a Mac doesn't come out of the box able to send mail. It only gets that ability if it is set up to do so (during

unicode fraction symbol in a NSTextView

2016-06-22 Thread Aandi Inston
Almost certainly not the font itself. Looks like classic mojibake. The sequence which you seem to report, capital A circumflex, one-half might be in the encoding ISO-8859-1 (aka Windows-1252 aka informally Latin1). If so we have c2 - capital A circumflex bd - one half But what is the UTF-8 form

Re: DNS resolution for apps vs Terminal?

2016-06-14 Thread Aandi Inston
Really facbook.com ? If so, maybe it's some kind of protection, the site is owned by MarkMonitor; perhaps there is a blocker on these things. On 14 June 2016 at 10:11, Rick Mann wrote: > Just now Safari stopped being able to load facbook.com. So did Chrome. > Both

Re: PDF image template comes out too small

2016-06-01 Thread Aandi Inston
I've never used this API but perhaps the problem is that you are thinking of PDF pages as having a size in pixels. They absolutely do not, because they are a rich collection of text, multiresolution images and vector. The fact that your PDF pages might contain only a single resolution image is of

32-bit / 64-bit roadmap

2016-01-21 Thread Aandi Inston
So far as I can see, all recent Mac OS systems are 64-bit on 64-bit hardware and can run an app shipped in 64-bit only. And 32-bit continues to run fine. But what about the future? Perhaps we can only speculate about whether 32-bit apps will be deprecated, but maybe Apple have started to hint

Re:

2016-01-19 Thread Aandi Inston
Thank you. The problem turned out to be a foolish mistake in the caller, but this has alerted me to the need for a systematic check of the conversion between BOOL and C integers. On 19 January 2016 at 17:15, Jake Petroules wrote: Note that BOOL is a typedef for

[no subject]

2016-01-19 Thread Aandi Inston
I have this handy routine: int MacNSOpenFileWithDefaultApp ( char *path ) { NSString *nsstring = [NSString stringWithUTF8String: path] ; BOOL ok = [[NSWorkspace sharedWorkspace] openFile:nsstring] ; return ok ; } Suppose we pass a folder name. The intention is to open the folder in the

Re: Bitmaps, colorspaces, etc.

2015-12-21 Thread Aandi Inston
I don't know anything about these methods. But in colour space work, "retagging" would usually mean changing the attached colour profile without changing the pixel values. For example, if an image starts as AppleRGB, it could be tagged as sRGB. This is not a conversion. The pixel values, numbers,

Translating offset from crash dump

2015-12-19 Thread Aandi Inston
This seems tangential to cocoa-dev, though I am in a callback from a Cocoa method, I don't think the crash is inside Cocoa but my own code. But here's the problem, maybe someone can suggest a better forum. I have a crash dump from a customer. I cannot reproduce the problem, and I cannot expect

Re: Drawing many different strings quickly

2015-09-28 Thread Aandi Inston
I'd like to suggest a different approach if things cannot be tuned to have far fewer draw calls. Font caching etc. is very fast, but not as fast as it could be given the choices it has to support. I think you said you had one font, one size. I'm guessing you also have no more than 256 different

Localised alert/confirm message

2015-09-22 Thread Aandi Inston
I use NSAlert to display a dialog with OK/Cancel, and noticed this had (wrongly) not been localized in my code. However, I noticed some other things. From the spec, if I replace OK/Cancel with other text, the automatic assignment of keyboard shortcuts is not done. All of this can be fixed, but I'm

Edit menu localisation, default application menu

2015-07-11 Thread Aandi Inston
It turns out, and I'm sure this will surprise nobody but me, that for the copy/paste/cut keyboard commands to work in Cocoa my app needs to have a suitable Edit menu with copy/paste/cut menu items and keyboard equivalents. My question is about localisation. The app is localised via its own string

First responder (?) problem, and orphaned highlight boxes

2015-04-15 Thread Aandi Inston
I am trying to solve a problem which seems to involve the first responder for an NSWindow. The NSWindow contains a number of controls and views, including several NSTextField controls. It is necessary to show or hide groups of these. These are all created dynamically, rather than with Interface

Painting standard check box/radio button mark

2015-04-09 Thread Aandi Inston
Is there a way to paint a standard check box or radio button mark, in its various states? I am implementing a custom control which would benefit from this. Clearly one could define a textless NSButton within one's own control, but I was wondering if there is a stock image repository for such

Re: NSButton (radio button) not calling action when overlapped by invisible NSButton?

2015-03-13 Thread Aandi Inston
(This is odd. I did not receive a copy of my post and therefore assumed it had not posted. Clearly it did as you were kind enough to reply) Happily I found the solution. This list earlier helped me to understand a problem which appeared in recent Mac OS, where radio buttons would all work as an

NSButton (radio button) not calling action when overlapped by invisible NSButton?

2015-03-10 Thread Aandi Inston
I am implementing the Cocoa back end of a portable control library, and have hit one particular strange problem. The dialogs are frequently very complex, with areas showing different groups of controls according to context. Individual controls are shown/hidden by the higher level code to make

NSWorkSpace performFileOperation (a)synchronousness

2015-03-05 Thread Aandi Inston
have a requirement to copy files from my Mac OS app. I find: success=[NSWorkSpace performFileOperation:NSWorkSpaceCopyOperation source:nsstring* // source directory path destination:nsstring* // target directory path file:nsarray* // nsstring array containing short paths of files or

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

Re: Kerning Pairs

2014-10-13 Thread Aandi Inston
It sounds like you're trying rrreay hard to avoid admitting to yourself that your model code needs to be rewritten. I don't think so as our model code works just fine when driven from Windows V-C that get a font, gets it its outline and mer table and call the model. Beautiful output.

Why not use path-based API? (was: Loading image resources)

2014-09-14 Thread Aandi Inston
No one should be using path-based API any more, generally. You should use URL-based equivalents. Why? Really, why? Certainly there are APIs where we have to use URL's and we have to convert the path into a URL, but where a non-deprecated path-based URL exists, what current or future obstacles

NSButton radio buttons, automatic grouping

2014-08-29 Thread Aandi Inston
I'm running the same code in 32-bit and 64-bit, and seeing a difference I cannot currently account for. The code is an implementation of a widget library, specifically the bit dealing with radio buttons. The radio buttons are created as NSButton instances with a buttonType of NSRadioButton. The

Transparent NSImage in NSButton

2014-08-19 Thread Aandi Inston
I'm wondering what the right way is to use transparent images in an NSButton (not using Interface Builder as this is a port of a platform independent dialog library, which is also required to work back to 10.5). Transparent images here = PDF loaded as NSImage which do not paint their entire

Aligning baseline of NS controls

2014-07-10 Thread Aandi Inston
I am porting a library for dynamic dialog creation to Cocoa. The implementation is using various standard controls such as NSTextField and NSButton. I have a question. Suppose a dialog is to contain a line with multiple controls like [ ] Add seconds [before/after] Here [ ] Add is a