I have an Objective-C MacOS app originally developed in Catalina on a 2012 Macbook Pro and recently ported to a 2019 MacBook Pro running Monterey and using Xcode 13.4 in response the App Store no longer accepting apps developed in Xcode 12, which is the newest version supported by Catalina. The app is targeting MacOS 12.0 (Catalina). The app builds and runs OK on Monterey, but when run on Catalina it crashes and the crash log error reason (NSCFConstantString stringByAppendingString:]: nil argument) is incorrect, as diagnosed by a series of log statements. The statement on which it fails is calling setSelectionIndex on an ImagesController class, which uses the NSArrayController interface.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
When running an Objective C app in Xcode 13.4 on Monterey on a 2019 MacBook Pro , app menu options sometimes only appear for as long the touchpad is pressed and the app is not responsive to menu selections. The Apple menu behaves similarly. The app can only be closed by stopping the run in Xcode. This behaviour is not reproducible - sometimes the menu appears normally.
have an Objective C app originally developed in Xcode 12.3 on Catalina and ported to Xcode 13.4 on Monterey. The minimum OS version is set to 10.12 (Catalina). In the app is a class ImageController defined as below, with a number of functions
ImageController.h
#import <Cocoa/Cocoa.h>
@class AppDelegate;
…
@interface ImagesController : NSArrayController {
…
- (void)addFileAtIndex:(NSString *)filePath index:(NSUInteger)index;
}
ImageController.m
#import "ImagesController.h"
…
#import "AppDelegate.h"
…
@implementation ImagesController
- (void)addFileAtIndex:(NSString*)filePath index:(NSUInteger) index{
...
NSMutableArray *filesToAdd = [NSMutableArray array];
[filesToAdd addObject:[CSSImageInfo containerWithPath:filePath]];
NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSetWithIndex:index];
self insertObjects:filesToAdd atArrangedObjectIndexes:indexSet];
NSInteger selectedIndex = [self selectionIndex];
…
}
When the function addFileAtIndex is called (with [imagesController addFileAtIndex:filename index:selectedIndex]; the app running on Monterey it executes normally. When is is called from the app running on Catalina it is never entered. What do I have to do to make the function accessible on Catalina?
Can MacOS apps be downloaded from outside the App Store as well as from it? I'd like to make it available directly from my web site as well as within the App Store.
I would like to record application log data in a file which iOS users can locate using the Files app and email to me in case of problems. Can I do this using the os_log functionality? The file path is defined as below:
let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
let documentsDirectory = paths[0]
let fileName = "\(Date()) CaptionEdit Logfile.txt"
let logFilePath = (documentsDirectory as NSString).appendingPathComponent(fileName)
I have a Swift 5.0 iOS app in Xcode 13 targeting iOS 14 where I try to access the Google Photoscan app programmatically using the following code running on an iPhone 8 with iOS 16
let photoScanURLString1 = "https://apps.apple.com/au/app/photoscan-by-google-photos/id116552994"
UIApplication.shared.open(NSURL(string:photoScanURLString1)! as URL)
This takes me to the App Store and shows the message "This app is currently not available in your region or country", which is en-AU, but does not go to the App page and let me download. The same behaviour is observed if I enter the URL photoScanURLString1 into Safari on the iPhone.
However, if I click the URL in a mail message I can download the app, and if I search for Google Photoscan in the App Store app I can download it OK.
How can I download the app from the App Store programmatically without changing my region in the iPhone settings?
The Main storyboard in an Xcode 14.01 Swift project workspace shows all panels as blank, Opening the Main.storyboard file (in Base.lproj folder) with Xcode shows it as expected but it appears blank when loaded into the project. Removing and adding the file does not show its content in Xcode.
I have been using an "Elements SE" 1 Tb USB hard drive for Time Machine backup on a 2012 MacBook Pro running Catalina, where it worked OK. When I plug the drive into a 2019 MacBook Pro running Monterey, Time Machine cannot write to it as it appears as read-only. Whe I try and inspect the disk using Disk Utility it appears as unmounted, and greyed out, and the Mount button is greyed out. First Aid on the disk fails. What do I have to do to make it useable by Time Machine on the 2019 MacBook Pro?
I have an Objective-C app running on MacOS using XCode 14.1, in which there are 3 levels of form. The Level 2 form is opened from an action with a makeKeyAndFront action from a button. The Level 3 form is a regular panel opened from the level 2 form in a similar way. The level 3 form can be closed normally if no action changes the level 2 form. However, if an image is loaded into an NSImageView control on the level 2 form, the level 3 form can be displayed but cannot be closed by clicking on the red x button which normally performs this function. The level 3 form can be minimised. What do I have to do to allow the level 3 form to be closed in this situation?
I would like my sandboxed MacOS app to save a log file in a sub-folder of the user's Documents folder, but the app cannot create the sub-folder, create a file or write to an existing file even though I have given the app full disk access via System Preferences-> Privacy. How can I do this?
The UIbarButtonItems in an iOS/ Swift app navigation bar in a view controller do not respond to clicks after navigation bar origin changed in the viewWillTransition event.
I have an image processing app for iOS that I would like to able to launch from Photos with a selected photo via the Share icon, in the same way that Messages, Mail and Notes (and a number of other apps) can be launched. How can I do this?
I'm getting the error "Cannot create Swift scratch context (couldn't create a ClangImporter)" when running a Swift project in XCode 12.3 on Catalina when I try to use the debugger. There is a resolution of this problem described at https://forums.raywenderlich.com/t/entering-debugger-in-swift-project-couldnt-create-a-clangimporter/130829 but I don't understand the fix of "removing zsh customisations in dotfiles". Can anyone explain what the files to change are and how they have to be changed? (I'm new to Mac development)
After submitting my app for review, I received a rejection on account of it crashing in MacOS 12.4 environment. The Objective-C app was developed in MacOS 12.4 and the app runs OK in Xcode and as a standalone executable. The crash log shows the exception type as SIGABRT and documentation. indicates that the crash may arise from an uncaught exception. Part of the crash log is shown below. How can I find out where the problem is occurring in my code?
Application Specific Backtrace 0:
0 CoreFoundation 0x00000001b15e5198 __exceptionPreprocess + 240
1 libobjc.A.dylib 0x00000001b132fe04 objc_exception_throw + 60
2 CoreFoundation 0x00000001b150cc98 -[__NSArrayM copyWithZone:] + 0
3 Caption Pro 0x000000010259db78 Caption Pro + 105336
4 Caption Pro 0x000000010259cc58 Caption Pro + 101464
5 Caption Pro 0x000000010259c720 Caption Pro + 100128
6 CoreFoundation 0x00000001b1558854 -[NSSet makeObjectsPerformSelector:] + 216
7 AppKit 0x00000001b40a678c -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 1080
8 AppKit 0x00000001b409aa70 loadNib + 416
9 AppKit 0x00000001b4099fa0 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:options:withZone:ownerBundle:] + 800
10 AppKit 0x00000001b4099ba4 -[NSBundle(NSNibLoading) loadNibNamed:owner:topLevelObjects:] + 220
11 AppKit 0x00000001b4099974 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 388
12 AppKit 0x00000001b408b740 NSApplicationMain + 576
13 dyld 0x00000001027c508c start + 520
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x1b1462d98 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1b1497ee0 pthread_kill + 288
2 libsystem_c.dylib 0x1b13d2340 abort + 168
3 libc++abi.dylib 0x1b1452b08 abort_message + 132
4 libc++abi.dylib 0x1b1442950 demangling_terminate_handler() + 336
5 libobjc.A.dylib 0x1b1338320 _objc_terminate() + 144
6 libc++abi.dylib 0x1b1451ea4 std::__terminate(void (*)()) + 20
7 libc++abi.dylib 0x1b1454c1c __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 36
8 libc++abi.dylib 0x1b1454bc8 __cxa_throw + 140
9 libobjc.A.dylib 0x1b132ff6c objc_exception_throw + 420
10 CoreFoundation 0x1b150cc98 -[__NSSingleObjectArrayI objectAtIndex:] + 140
11 Caption Pro 0x10259db78 0x102584000 + 105336
12 Caption Pro 0x10259cc58 0x102584000 + 101464
13 Caption Pro 0x10259c720 0x102584000 + 100128
14 CoreFoundation 0x1b1558854 -[NSSet makeObjectsPerformSelector:] + 216
15 AppKit 0x1b40a678c -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 1080
16 AppKit 0x1b409aa70 loadNib + 416
17 AppKit 0x1b4099fa0 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:options:withZone:ownerBundle:] + 800
18 AppKit 0x1b4099ba4 -[NSBundle(NSNibLoading) loadNibNamed:owner:topLevelObjects:] + 220
19 AppKit 0x1b4099974 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 388
20 AppKit 0x1b408b740 NSApplicationMain + 576
21 dyld 0x1027c508c start + 520
I have an NSImage that I would like to pad out with white pixels. How can I do this?