From e43e1a873e0641c3ef1893a612d32b55066c8f3b Mon Sep 17 00:00:00 2001 From: Andrea Brugnoli Date: Mon, 14 Sep 2026 08:48:28 +0200 Subject: [PATCH] Fix build on Apple Silicon, modernize a few deprecated AppKit constants - raise MACOSX_DEPLOYMENT_TARGET from 10.8 to 11.0 (below current Xcode's minimum supported deployment target, 10.13; 11.0 is also the first macOS release for Apple Silicon) - drop leftover Swift bridging-header build settings (no .swift files exist in the project) - replace deprecated NSRightTextAlignment/NSLeftTextAlignment/ NSCenterTextAlignment, NSStringPboardType, NSFileHandlingPanelOKButton, NSOnState/NSOffState with their modern equivalents Verified: clean Release build with current Xcode produces a native arm64 binary, app launches and opens/saves CSV files without issue, existing test suite passes unchanged. Co-Authored-By: Claude Sonnet 5 --- Table Tool.xcodeproj/project.pbxproj | 10 +++------- Table Tool/Document.m | 14 +++++++------- Table Tool/TTFormatViewController.m | 4 ++-- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Table Tool.xcodeproj/project.pbxproj b/Table Tool.xcodeproj/project.pbxproj index e35ccfb..5d736b2 100644 --- a/Table Tool.xcodeproj/project.pbxproj +++ b/Table Tool.xcodeproj/project.pbxproj @@ -231,8 +231,7 @@ E1CC84D31B4A5F2A00ED8314 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 1700; ORGANIZATIONNAME = "Egger Apps"; TargetAttributes = { E1CC84DA1B4A5F2A00ED8314 = { @@ -392,7 +391,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -431,7 +430,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; @@ -448,8 +447,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = at.eggerapps.tabletool; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Table Tool/Table Tool-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; @@ -464,7 +461,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = at.eggerapps.tabletool; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Table Tool/Table Tool-Bridging-Header.h"; }; name = Release; }; diff --git a/Table Tool/Document.m b/Table Tool/Document.m index bbc7a46..8ec249e 100644 --- a/Table Tool/Document.m +++ b/Table Tool/Document.m @@ -267,9 +267,9 @@ -(void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColum NSArray *rowArray = [_data objectAtIndex:rowIndex]; if(rowArray.count > tableColumn.identifier.integerValue){ if([rowArray[tableColumn.identifier.integerValue] isKindOfClass:[NSDecimalNumber class]]){ - textCell.alignment = NSRightTextAlignment; + textCell.alignment = NSTextAlignmentRight; }else{ - textCell.alignment = NSLeftTextAlignment; + textCell.alignment = NSTextAlignmentLeft; } } } @@ -326,7 +326,7 @@ -(void)initValidPBoardTypes { validPBoardTypes = [NSArray arrayWithObjects:TTRowInternalPboardType, NSPasteboardTypeTabularText, - NSStringPboardType, + NSPasteboardTypeString, nil]; } @@ -569,7 +569,7 @@ -(void)updateTableColumns { NSTableColumn *tableColumn = [[NSTableColumn alloc] initWithIdentifier:[NSString stringWithFormat:@"%d",i]]; tableColumn.dataCell = dataCell; tableColumn.headerCell.stringValue = i < columnNames.count ? columnNames[i] : [self generateColumnName:i]; - ((NSCell *)tableColumn.headerCell).alignment = NSCenterTextAlignment; + ((NSCell *)tableColumn.headerCell).alignment = NSTextAlignmentCenter; [self.tableView addTableColumn: tableColumn]; } } @@ -579,7 +579,7 @@ -(void)updateTableColumnsNames { for(int i = 0; i < [self.tableView.tableColumns count]; i++) { NSTableColumn *tableColumn = self.tableView.tableColumns[i]; tableColumn.headerCell.stringValue = [self generateColumnName:i]; - ((NSCell *)tableColumn.headerCell).alignment = NSCenterTextAlignment; + ((NSCell *)tableColumn.headerCell).alignment = NSTextAlignmentCenter; } } } @@ -903,7 +903,7 @@ -(void)restoreColumns:(NSMutableArray *)columnIds atIndexes:(NSIndexSet *)column if(self.csvConfig.firstRowAsHeader){ col.headerCell.stringValue = [columnNames objectAtIndex:((NSString *)columnIds[i]).integerValue]; } - ((NSCell *)col.headerCell).alignment = NSCenterTextAlignment; + ((NSCell *)col.headerCell).alignment = NSTextAlignmentCenter; [self.tableView addTableColumn:col]; [self.tableView moveColumn:[self.tableView numberOfColumns]-1 toColumn:[columnIndexes firstIndex]+i]; } @@ -1134,7 +1134,7 @@ -(IBAction)exportFile:(id)sender { [accessoryViewController selectFormatByConfig]; savePanel.allowedFileTypes = [NSArray arrayWithObject:@"csv"]; [savePanel beginSheetModalForWindow:window completionHandler:^(NSInteger result){ - if (result == NSFileHandlingPanelOKButton) + if (result == NSModalResponseOK) { NSError *error = nil; NSData *data = [self dataWithCSVConfig:accessoryViewController.config error:&error]; diff --git a/Table Tool/TTFormatViewController.m b/Table Tool/TTFormatViewController.m index 9caac93..2a7b703 100644 --- a/Table Tool/TTFormatViewController.m +++ b/Table Tool/TTFormatViewController.m @@ -47,7 +47,7 @@ - (IBAction)updateConfiguration:(id)sender { } _config.escapeCharacter = [[self.escapeControl labelForSegment:[self.escapeControl selectedSegment]] substringToIndex:1]; - _config.firstRowAsHeader = (self.useFirstRowAsHeaderCheckbox.state == NSOnState); + _config.firstRowAsHeader = (self.useFirstRowAsHeaderCheckbox.state == NSControlStateValueOn); [self.delegate configurationChangedForFormatViewController:self]; } @@ -85,7 +85,7 @@ -(void)selectFormatByConfig{ [_escapeControl selectSegmentWithTag:2]; } - self.useFirstRowAsHeaderCheckbox.state = self.config.firstRowAsHeader ? NSOnState : NSOffState; + self.useFirstRowAsHeaderCheckbox.state = self.config.firstRowAsHeader ? NSControlStateValueOn : NSControlStateValueOff; } @end