Posts

Post not yet marked as solved
2 Replies
454 Views
I am porting a macOS Objective-C app from just Intel silicon to universal binary -- Intel and Apple silicon both -- using Xcode 13.2.1, building on a 2019 Mac Pro running macOS 11.6.4. I have followed all the instructions here: https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary. In particular, in Xcode's "build" settings, "Architectures" is set to "Standard Architectures (Apple Silicon, Intel) - $(ARCHS_STANDARD)", and "Build Active Architecture Only" is set to "No". Yet when I use Xcode to build either the release or the debug version of my app, the shell command: lipo -archs <path to MyApp.app>/Contents/MacOS/<MyApp> returns only "x86_64", and indeed, the app doesn't even start initialization when I test it on a Mac Mini with Apple silicon. What could I be doing wrong?
Posted
by Knightley.
Last updated
.
Post not yet marked as solved
0 Replies
132 Views
I have been setting up MacOS color filters via "System Preferences" -> "Accessibility" -> "Display" -> "Color Filters". When I set it up, the filter effect only shows up on two of the four monitors I have attached to my Mac Pro. (The two that work are a Samsung LC49G95T and a Dell S3221QS; the two that do not are both HP2509s.) I have filed a bug report with Apple on this, but it occurs to me that it might be helpful to add to it any other users' experiences with monitors that do and do not "work" with color filters. Has anyone else seen this phenomenon? Alternatively, does anyone have any suggestions for getting the 2509s to show the filtering?
Posted
by Knightley.
Last updated
.
Post not yet marked as solved
1 Replies
237 Views
I need to know more about how macOS uses user-process virtual address space in ways not explicily requested by the user. In detail, I have a process that needs to mmap a file to a specific virtual address. I don't care what the address is, but I need to know it at compile-time. I know how to set up such a mapping, and how to specify in the executable that a particular chunk of virtual address space is reserved for it: Specifically, my Xcode build includes a .s file containing a .zerofill directive to create a named segment and section of the required size, and I use the -segaddr flag in the linker to specify the virtual address where that segment is to be loaded. I can then use the address and size that I have chosen, elsewhere in my source code, via mmap with MAP_FIXED. This method seems to protect the special segment from being used by macOS, which is of course what I want. My problem is, I don't know whether the location I have chosen for the new segment is inconveniencing macOS in some undesirable way: For example, staking out a big chunk of user memory in the wrong place might restrict the space available to the memory allocation system, or limit stack growth, or some such thing. At the moment, my empirical choice of location works on my own Macs, but it might not work on others, or on other versions of macOS. What I am looking for -- and haven't found -- is documentation about how macOS user-process virtual address space is used, in sufficient detail that I can choose the location of my special segment so that it does not get in the way. I need to know it for both the x86_64 architecture and the arm64 architecture, and I need to know how that usage might vary from machine to machine and from macOS version to macOS version. Can anyone help or advise? (For the curious, I need to mmap the file to a specific virtual address because it is binary data that contains absolute pointers to locations within itself. I can set up the pointers correctly for any given mmap loading address when I first mmap the file, but I need each subsequent process that mmaps the same file to be able to dereference pointers correctly -- thus I need a fixed load address that all processes can use when mmapping.)
Posted
by Knightley.
Last updated
.
Post not yet marked as solved
0 Replies
231 Views
I have a MacOS app which has its own documents. The documents are supposed to have custom icons, so that they are easily identifiable on -- e.g. -- the Desktop. They used to be visible, but they aren't now. In more detail ... I have been upgrading and old app that was last built (in Objective C, using Xcode) under MacOS 10.13 (High Sierra). I have gotten the upgrade to build and run under Big Sur (still Objective C and Xcode). Both the old and the new versions of the app successfully write usable documents. The documents created by both the old and the new app do show up on the Desktop with the correct icons when I copy the documents to an old Mac running High Sierra. They also show when I copy them to a Mac running Mojave. (I don't happen to have a Catalina partition handy, so I can't say about Catalina.) The exact same documents do not show up with the correct icons when I copy them to a newer Mac running Big Sur -- they show up with generic document icons. I have both the old and the new versions of the app installed on all these machines, so the Finder can do whatever it does to both versions to find out about document icons. Obviously (I think), something has changed about how the Finder gets information about document icons, between Mojave and Big Sur, or possibly between Catalina and Big Sur. Does anyone know what it is? In particular, are there some new key/value pairs I should add to my Info.plist or to the Custom macOS Application Properties panel in Xcode, to make my custom document icons show up?
Posted
by Knightley.
Last updated
.
Post not yet marked as solved
0 Replies
235 Views
I am developing with Objective C. In Xcode, I have a single .nib file with several NSWindows in it besides the app's main window. I wish to use addChildWindow:, etc., to attach the extra windows to the main window and (e.g.) move them around. Thus in the .nib editor, I have used the Connections Inspector to make connections ("drag lines") to the windows from IBOutlets in a central controller (special class, not an NSWindowController or an NSViewController) where I have put code to run addChildWindow:, etc. The problem is, that the connections aren't getting created. When I check in my central controller's "awakeFromNib" method, I find that the IBOutlets to my windows are all null at that time. There is a whole lot on the net about people having this kind of problem with NSViews, and the recommended solutions involve NSViewControllers: Let me stress that my connections are not to NSViews, but to NSWindows. I am not sure how to apply the advice for NSViews to my problem. My "extra" windows are in essence static -- I just use their views to display things to the user (via, e.g. NSTextFields) or to get input from the user (via, e.g., NSButtons), so I haven't any need for the content-altering functions of window or view controllers. Besides, I am not sure how I would go about connecting my windows or their content views to an NSWindowController or an NSViewController, because the IBOutlets haven't been loaded when I need them. Thus I am stuck in a loop: I can't use null IBOutlets to connect windows and views to window or view controllers, but I seem to need controllers with the windows or views already connected in order to load things and thereby get the IBOutlets to be non-null. Is there a way out?
Posted
by Knightley.
Last updated
.
Post marked as solved
5 Replies
1.7k Views
I am running a MacPro7,1 with Big Sur 11.6 and Xcode 13.0. When I open the main nib file for my application, the editor is completely blank -- nothing shows up. The app builds and runs as expected, so it is not like the nib has vanished. The nib has been visible recently, but I am not aware of anything unusual that I might have done to it to cause damage. The behavior repeats after a project clean, and also after closing Xcode and reopening it. Does anyone have any ideas of what might be going on, and how to fix the problem?
Posted
by Knightley.
Last updated
.
Post marked as solved
2 Replies
409 Views
I am developing in C++ and Objective C using Xcode 13.1, running on a 2019 Mac Pro with Big Sur 11.6.1. I am working on an app to run on (only) Macintoshes with Intel silicon. (Apple silicon will involve a port, later.) In Xcode, my compiler is set to Apple CLang, with defaults across the board. I need to embed some Intel assembly-language code in some of the C++ code for my application. I can't find any manuals or examples for how to do that. I have written Intel assembler before, but not for a long time, and never embedded in a MacOS app. Can someone recommend any books or links to documentation or examples? Apple's own documentation seems in great part no longer maintained.
Posted
by Knightley.
Last updated
.
Post not yet marked as solved
1 Replies
342 Views
It looks like I will eventually have to reverse-engineer and replace NSDrawer for one of my MacOs apps. There has been talk here and there about doing that, and I wondered if anyone had done so and would be willing to share or give hints. For the record: (1) My use of NSDrawer is appropriate under the original human interface guidelines for it, which were "[u]se drawers only for controls that need to be accessed fairly frequently but that don't need to be visible all the time." (2) NSSplitView is not appropriate because (a) my app is text-based, and it is very disconcerting to have the text re-flowed when the extra view opens and closes, and (b) I need more than one drawer (for different sets of controls, useful in different circumstances). (3) Various other kind of view don't work because of one or more of (a) they block content in the main view, (b) they do not automatically appear at the same position relative to the main view, or (c) they do not follow the main view when the user moves  or resizes it. (Note that requirements (b) and (c) follow from Fitt's law.) My app is a program-development environment for the Scheme programming language, called "Wraith Scheme".
Posted
by Knightley.
Last updated
.
Post not yet marked as solved
0 Replies
270 Views
Ten years or so ago I had an iPad app called ***** Scheme III on the app store. I stopped upgrading it, and it is no longer there, and indeed, it does not run on current devices. I recently received email from someone who has an original iPad, which would run the app, and who wants it. Is there any way I can get a copy to that person?
Posted
by Knightley.
Last updated
.