macos 12 doesn't like singletons in nibs

This commit is contained in:
Kelvin Sherlock 2022-02-23 22:32:33 -05:00
parent 1dd3664a2b
commit ce35015218
3 changed files with 70 additions and 36 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -20,7 +20,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="400" height="450"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="400" height="450"/>
<autoresizingMask key="autoresizingMask"/>
@ -28,20 +28,19 @@
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cgh-jG-i97">
<rect key="frame" x="-1" y="-1" width="402" height="452"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" ambiguous="YES" id="xDr-v4-sVR">
<rect key="frame" x="1" y="0.0" width="400" height="451"/>
<clipView key="contentView" id="xDr-v4-sVR">
<rect key="frame" x="1" y="1" width="400" height="450"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="hmS-CB-Huq" viewBased="YES" id="mkQ-pQ-kXu">
<rect key="frame" x="0.0" y="0.0" width="400" height="426"/>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="hmS-CB-Huq" viewBased="YES" id="mkQ-pQ-kXu">
<rect key="frame" x="0.0" y="0.0" width="400" height="425"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="241" minWidth="40" maxWidth="1000" id="U9x-dw-Kd3">
<tableColumn width="232" minWidth="40" maxWidth="1000" id="U9x-dw-Kd3">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Name">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
@ -54,11 +53,11 @@
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="R8h-Wj-cHA">
<rect key="frame" x="1" y="1" width="241" height="17"/>
<rect key="frame" x="1" y="1" width="237" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cIh-ya-lB0">
<rect key="frame" x="0.0" y="0.0" width="241" height="17"/>
<rect key="frame" x="0.0" y="0.0" width="237" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" title="Table View Cell" id="a7b-vf-Kzd">
<font key="font" metaFont="system"/>
@ -82,7 +81,6 @@
</tableColumn>
<tableColumn editable="NO" width="100" minWidth="100" maxWidth="100" id="fvh-YG-X9R">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Machine">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableHeaderCell>
@ -95,7 +93,7 @@
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="LUd-BZ-Kpw">
<rect key="frame" x="245" y="1" width="100" height="17"/>
<rect key="frame" x="241" y="1" width="100" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4Qd-Zj-XZi">
@ -119,7 +117,6 @@
</tableColumn>
<tableColumn editable="NO" width="50" minWidth="50" maxWidth="50" id="rmr-1r-2Cb">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Default">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableHeaderCell>
@ -132,11 +129,11 @@
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="f3C-qX-bVY">
<rect key="frame" x="348" y="1" width="50" height="17"/>
<rect key="frame" x="344" y="1" width="54" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LzD-ps-EdD">
<rect key="frame" x="17" y="1" width="16" height="16"/>
<rect key="frame" x="19" y="1" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSStatusAvailable" id="kH7-IH-D1y"/>
<connections>
@ -173,7 +170,7 @@
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" id="hmS-CB-Huq">
<tableHeaderView key="headerView" wantsLayer="YES" id="hmS-CB-Huq">
<rect key="frame" x="0.0" y="0.0" width="400" height="25"/>
<autoresizingMask key="autoresizingMask"/>
</tableHeaderView>
@ -185,14 +182,14 @@
</connections>
<point key="canvasLocation" x="-72" y="91"/>
</window>
<arrayController mode="entity" entityName="Bookmark" automaticallyPreparesContent="YES" preservesSelection="NO" selectsInsertedObjects="NO" avoidsEmptySelection="NO" clearsFilterPredicateOnInsertion="NO" automaticallyRearrangesObjects="YES" id="7gA-MI-adT">
<arrayController mode="entity" entityName="Bookmark" automaticallyPreparesContent="YES" preservesSelection="NO" selectsInsertedObjects="NO" avoidsEmptySelection="NO" clearsFilterPredicateOnInsertion="NO" id="7gA-MI-adT">
<connections>
<binding destination="Ryd-Nr-sPf" name="managedObjectContext" keyPath="managedObjectContext" id="hMi-JG-LQC"/>
<binding destination="-2" name="selectionIndexes" keyPath="tableView.selectedRowIndexes" id="dyb-Wv-Duo"/>
<binding destination="-2" name="sortDescriptors" keyPath="tableView.sortDescriptors" previousBinding="dyb-Wv-Duo" id="fkc-Yv-ZLN"/>
</connections>
</arrayController>
<customObject id="Ryd-Nr-sPf" customClass="BookmarkManager"/>
<customObject id="Ryd-Nr-sPf" customClass="BookmarkManagerProxy"/>
<menu id="cH2-L7-ScC">
<items>
<menuItem title="Set Default" id="JGR-HC-oCO">

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -15,7 +15,7 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="stE-9g-lJ2" customClass="BookmarkManager"/>
<customObject id="stE-9g-lJ2" customClass="BookmarkManagerProxy"/>
<arrayController mode="entity" entityName="DiskImage" automaticallyPreparesContent="YES" avoidsEmptySelection="NO" automaticallyRearrangesObjects="YES" id="YmL-8S-msS">
<connections>
<binding destination="stE-9g-lJ2" name="managedObjectContext" keyPath="managedObjectContext" id="GyD-kH-DBa"/>
@ -45,7 +45,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="283" y="305" width="408" height="270"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<view key="contentView" id="zHI-2R-bOe">
<rect key="frame" x="0.0" y="0.0" width="408" height="270"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@ -53,12 +53,12 @@
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="a3G-Wf-K8I">
<rect key="frame" x="-1" y="-1" width="410" height="272"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" ambiguous="YES" id="SFr-s6-6di">
<rect key="frame" x="1" y="0.0" width="408" height="271"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" id="SFr-s6-6di">
<rect key="frame" x="1" y="1" width="408" height="270"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="iwP-JL-O3g" viewBased="YES" id="cqO-ig-A9t">
<rect key="frame" x="0.0" y="0.0" width="408" height="246"/>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="iwP-JL-O3g" viewBased="YES" id="cqO-ig-A9t">
<rect key="frame" x="0.0" y="0.0" width="408" height="245"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -66,7 +66,6 @@
<tableColumns>
<tableColumn width="300" minWidth="40" maxWidth="1000" id="k9E-Si-iTY">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Name">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
@ -79,11 +78,11 @@
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="2Ic-UI-Je3">
<rect key="frame" x="1" y="1" width="300" height="17"/>
<rect key="frame" x="1" y="1" width="305" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gkM-KB-x76">
<rect key="frame" x="0.0" y="0.0" width="300" height="17"/>
<rect key="frame" x="0.0" y="0.0" width="305" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="PitchDark.2mg" id="Wcg-zo-CeN">
<font key="font" metaFont="system"/>
@ -102,9 +101,8 @@
</tableCellView>
</prototypeCellViews>
</tableColumn>
<tableColumn width="102" minWidth="40" maxWidth="1000" id="0aJ-xJ-YSS">
<tableColumn width="93" minWidth="40" maxWidth="1000" id="0aJ-xJ-YSS">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Size">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
@ -117,11 +115,11 @@
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="UW9-AF-U9F">
<rect key="frame" x="304" y="1" width="102" height="17"/>
<rect key="frame" x="309" y="1" width="97" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6Ry-Zn-euh">
<rect key="frame" x="0.0" y="0.0" width="102" height="17"/>
<rect key="frame" x="0.0" y="0.0" width="97" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="32 MB" id="fXp-OZ-Qcu">
<font key="font" metaFont="system"/>
@ -177,7 +175,7 @@
<nil key="toolTip"/>
<searchField key="view" wantsLayer="YES" verticalHuggingPriority="750" textCompletion="NO" id="qHV-IA-ysc">
<rect key="frame" x="0.0" y="14" width="96" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<autoresizingMask key="autoresizingMask"/>
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" continuous="YES" borderStyle="bezel" placeholderString="Filter" usesSingleLineMode="YES" bezelStyle="round" id="BWo-eC-ahz">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>

View File

@ -69,6 +69,7 @@ static BookmarkManager *singleton = nil;
}
//singleton = self;
return self;
}
@ -585,4 +586,42 @@ static NSString *kMenuContext = @"";
}
@end
/* MacOS 12.1+ doesn't like class clusters in nibs -
[General] This coder is expecting the replaced object 0x600000938f60 to be returned from
NSClassSwapper.initWithCoder instead of <BookmarkManager: 0x600000905da0>
*/
@interface BookmarkManagerProxy : NSProxy {
BookmarkManager *_target;
}
@end
@implementation BookmarkManagerProxy
-(id)init {
_target = [BookmarkManager sharedManager];
return self;
}
-(NSMethodSignature *)methodSignatureForSelector:(SEL)sel {
return [_target methodSignatureForSelector: sel];
}
+(BOOL)respondsToSelector:(SEL)aSelector {
return [BookmarkManager respondsToSelector: aSelector];
}
-(void)forwardInvocation:(NSInvocation *)invocation {
if ([_target respondsToSelector: [invocation selector]]) {
[invocation invokeWithTarget: _target];
} else {
[super forwardInvocation: invocation];
}
}
@end