2
0

Fix potential crash due to reloading of main view and gesture recognizers.

[MOVED]     Search delegates and controllers and gesture recognizers are now fully handled by the storyboard.
This commit is contained in:
Maarten Billemont 2013-10-17 08:15:29 -04:00
parent 6e9cd5a1f5
commit b11b33da5f
5 changed files with 52 additions and 29 deletions

@ -1 +1 @@
Subproject commit b2ad0ef886ff6700ef6f7371cabe35e10e73cd6c Subproject commit 51bcfb691ed906fcbbec4e020234fdbef21a2288

View File

@ -5,17 +5,15 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key> <key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/> <false/>
<key>IDESourceControlProjectIdentifier</key> <key>IDESourceControlProjectIdentifier</key>
<string>CE2CFE46-2421-46AB-8B34-0FD2B03C1222</string> <string>D4AB9F0C-D746-4319-AABF-B24705099AED</string>
<key>IDESourceControlProjectName</key> <key>IDESourceControlProjectName</key>
<string>MasterPassword</string> <string>MasterPassword</string>
<key>IDESourceControlProjectOriginsDictionary</key> <key>IDESourceControlProjectOriginsDictionary</key>
<dict> <dict>
<key>35C761A6-90CF-4EF5-93DA-E38ECBAD949A</key> <key>2B6DA448-3730-4F84-B2C3-51272E0D42F3</key>
<string>https://github.com/domesticcatsoftware/DCIntrospect.git</string> <string>ssh://github.com/lhunath/DCIntrospect.git</string>
<key>5263993D-5FE8-464F-B66E-B0F7C2DFF410</key> <key>5263993D-5FE8-464F-B66E-B0F7C2DFF410</key>
<string>ssh://github.com/lhunath/UbiquityStoreManager.git</string> <string>ssh://github.com/lhunath/UbiquityStoreManager.git</string>
<key>56D4C2AF-681C-406B-A5EA-C7FC4FA88907</key>
<string>git://github.com/futuretap/InAppSettingsKit.git</string>
<key>6A449EC2-A2A3-4635-9C5F-A811E011EAC3</key> <key>6A449EC2-A2A3-4635-9C5F-A811E011EAC3</key>
<string>ssh://github.com/Lyndir/MasterPassword.git</string> <string>ssh://github.com/Lyndir/MasterPassword.git</string>
<key>ADA0D7F9-4871-4128-8FEE-FD1021EEF3AC</key> <key>ADA0D7F9-4871-4128-8FEE-FD1021EEF3AC</key>
@ -24,6 +22,8 @@
<string>git://github.com/lhunath/uicolor-utilities.git</string> <string>git://github.com/lhunath/uicolor-utilities.git</string>
<key>B0F634DD-AEE1-4F0D-AE35-4FAF51AD1B5A</key> <key>B0F634DD-AEE1-4F0D-AE35-4FAF51AD1B5A</key>
<string>git://github.com/lhunath/RHStatusItemView.git</string> <string>git://github.com/lhunath/RHStatusItemView.git</string>
<key>CBA93B91-B799-4CC6-85B6-749792B76DD4</key>
<string>ssh://github.com/lhunath/InAppSettingsKit.git</string>
<key>E4C8E206-229C-4DA8-A130-0C544DEC7E07</key> <key>E4C8E206-229C-4DA8-A130-0C544DEC7E07</key>
<string>git://github.com/jonmarimba/jrswizzle.git</string> <string>git://github.com/jonmarimba/jrswizzle.git</string>
<key>FF42A9E0-F41C-42FC-88CD-F2CCDE15DBB6</key> <key>FF42A9E0-F41C-42FC-88CD-F2CCDE15DBB6</key>
@ -33,12 +33,10 @@
<string>MasterPassword.xcworkspace</string> <string>MasterPassword.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key> <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict> <dict>
<key>35C761A6-90CF-4EF5-93DA-E38ECBAD949A</key> <key>2B6DA448-3730-4F84-B2C3-51272E0D42F3</key>
<string>../External/DCIntrospect</string> <string>../External/DCIntrospect</string>
<key>5263993D-5FE8-464F-B66E-B0F7C2DFF410</key> <key>5263993D-5FE8-464F-B66E-B0F7C2DFF410</key>
<string>../External/UbiquityStoreManager</string> <string>../External/UbiquityStoreManager</string>
<key>56D4C2AF-681C-406B-A5EA-C7FC4FA88907</key>
<string>../External/InAppSettingsKit</string>
<key>6A449EC2-A2A3-4635-9C5F-A811E011EAC3</key> <key>6A449EC2-A2A3-4635-9C5F-A811E011EAC3</key>
<string>..</string> <string>..</string>
<key>ADA0D7F9-4871-4128-8FEE-FD1021EEF3AC</key> <key>ADA0D7F9-4871-4128-8FEE-FD1021EEF3AC</key>
@ -47,6 +45,8 @@
<string>../External/Pearl/External/uicolor-utilities</string> <string>../External/Pearl/External/uicolor-utilities</string>
<key>B0F634DD-AEE1-4F0D-AE35-4FAF51AD1B5A</key> <key>B0F634DD-AEE1-4F0D-AE35-4FAF51AD1B5A</key>
<string>../External/RHStatusItemView</string> <string>../External/RHStatusItemView</string>
<key>CBA93B91-B799-4CC6-85B6-749792B76DD4</key>
<string>../External/InAppSettingsKit</string>
<key>E4C8E206-229C-4DA8-A130-0C544DEC7E07</key> <key>E4C8E206-229C-4DA8-A130-0C544DEC7E07</key>
<string>../External/Pearl/External/jrswizzle</string> <string>../External/Pearl/External/jrswizzle</string>
<key>FF42A9E0-F41C-42FC-88CD-F2CCDE15DBB6</key> <key>FF42A9E0-F41C-42FC-88CD-F2CCDE15DBB6</key>
@ -64,7 +64,7 @@
<key>IDESourceControlRepositoryExtensionIdentifierKey</key> <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string> <string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key> <key>IDESourceControlWCCIdentifierKey</key>
<string>35C761A6-90CF-4EF5-93DA-E38ECBAD949A</string> <string>2B6DA448-3730-4F84-B2C3-51272E0D42F3</string>
<key>IDESourceControlWCCName</key> <key>IDESourceControlWCCName</key>
<string>DCIntrospect</string> <string>DCIntrospect</string>
</dict> </dict>
@ -80,7 +80,7 @@
<key>IDESourceControlRepositoryExtensionIdentifierKey</key> <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string> <string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key> <key>IDESourceControlWCCIdentifierKey</key>
<string>56D4C2AF-681C-406B-A5EA-C7FC4FA88907</string> <string>CBA93B91-B799-4CC6-85B6-749792B76DD4</string>
<key>IDESourceControlWCCName</key> <key>IDESourceControlWCCName</key>
<string>InAppSettingsKit</string> <string>InAppSettingsKit</string>
</dict> </dict>

View File

@ -289,6 +289,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext,
NSManagedObjectContext *moc = [self mainManagedObjectContextIfReady]; NSManagedObjectContext *moc = [self mainManagedObjectContextIfReady];
[moc performBlockAndWait:^{ [moc performBlockAndWait:^{
[moc saveToStore]; [moc saveToStore];
[moc reset];
self.privateManagedObjectContext = nil; self.privateManagedObjectContext = nil;
self.mainManagedObjectContext = nil; self.mainManagedObjectContext = nil;

View File

@ -55,23 +55,6 @@
- (void)viewDidLoad { - (void)viewDidLoad {
self.searchDelegate = [MPElementListSearchController new];
self.searchDelegate.delegate = self;
self.searchDelegate.searchDisplayController = self.searchDisplayController;
self.searchDelegate.searchTipContainer = self.searchTipContainer;
self.searchDisplayController.searchBar.delegate = self.searchDelegate;
self.searchDisplayController.delegate = self.searchDelegate;
self.searchDisplayController.searchResultsDelegate = self.searchDelegate;
self.searchDisplayController.searchResultsDataSource = self.searchDelegate;
[self.passwordIncrementer addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self
action:@selector(resetPasswordCounter:)]];
[self.loginNameContainer addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self
action:@selector(editLoginName:)]];
[self.loginNameContainer addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(copyLoginName:)]];
[self.outdatedAlertBack addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(infoOutdatedAlert)]];
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"ui_background"]]; self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"ui_background"]];
self.alertBody.text = nil; self.alertBody.text = nil;

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4510" systemVersion="12E55" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="KZF-fe-y9n"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4510" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="KZF-fe-y9n">
<dependencies> <dependencies>
<deployment defaultVersion="1536" identifier="iOS"/> <deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
@ -674,6 +674,7 @@ Your passwords will be AES-encrypted with your master password.</string>
</state> </state>
<connections> <connections>
<action selector="incrementPasswordCounter" destination="PQa-Xl-A3x" eventType="touchUpInside" id="hMc-kb-yFA"/> <action selector="incrementPasswordCounter" destination="PQa-Xl-A3x" eventType="touchUpInside" id="hMc-kb-yFA"/>
<outletCollection property="gestureRecognizers" destination="Frb-Ve-w79" appends="YES" id="5dU-0R-IR7"/>
</connections> </connections>
</button> </button>
<button opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="9FS-fS-xH6" userLabel="Button - Edit"> <button opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="9FS-fS-xH6" userLabel="Button - Edit">
@ -726,6 +727,10 @@ Your passwords will be AES-encrypted with your master password.</string>
</textField> </textField>
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<connections>
<outletCollection property="gestureRecognizers" destination="SfB-KW-KnA" appends="YES" id="EF5-oz-f2K"/>
<outletCollection property="gestureRecognizers" destination="Qyt-6l-shg" appends="YES" id="Bi9-JM-jxt"/>
</connections>
</view> </view>
</subviews> </subviews>
</view> </view>
@ -791,6 +796,9 @@ Your passwords will be AES-encrypted with your master password.</string>
<gestureRecognizers/> <gestureRecognizers/>
<color key="tintColor" red="0.37254901959999998" green="0.3921568627" blue="0.42745098040000001" alpha="1" colorSpace="calibratedRGB"/> <color key="tintColor" red="0.37254901959999998" green="0.3921568627" blue="0.42745098040000001" alpha="1" colorSpace="calibratedRGB"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="URL"/> <textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="URL"/>
<connections>
<outlet property="delegate" destination="S88-IL-SpJ" id="gA4-6d-Fu5"/>
</connections>
</searchBar> </searchBar>
<view hidden="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleToFill" id="foz-tW-xGw" userLabel="View - Action Tip"> <view hidden="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleToFill" id="foz-tW-xGw" userLabel="View - Action Tip">
<rect key="frame" x="10" y="0.0" width="300" height="60"/> <rect key="frame" x="10" y="0.0" width="300" height="60"/>
@ -920,6 +928,9 @@ Your passwords will be AES-encrypted with your master password.</string>
<rect key="frame" x="0.0" y="0.0" width="300" height="180"/> <rect key="frame" x="0.0" y="0.0" width="300" height="180"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<rect key="contentStretch" x="0.25" y="0.6499999999999998" width="0.64999999999999969" height="0.10000000000000002"/> <rect key="contentStretch" x="0.25" y="0.6499999999999998" width="0.64999999999999969" height="0.10000000000000002"/>
<connections>
<outletCollection property="gestureRecognizers" destination="6vw-jn-qnG" appends="YES" id="4Io-l8-ID5"/>
</connections>
</imageView> </imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Outdated Sites" lineBreakMode="tailTruncation" minimumFontSize="10" id="ga8-ha-4zb"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Outdated Sites" lineBreakMode="tailTruncation" minimumFontSize="10" id="ga8-ha-4zb">
<rect key="frame" x="70" y="20" width="210" height="21"/> <rect key="frame" x="70" y="20" width="210" height="21"/>
@ -1077,6 +1088,7 @@ L4m3P4sSw0rD</string>
<outlet property="pullDownView" destination="qgs-1p-CRh" id="XWn-9h-aYM"/> <outlet property="pullDownView" destination="qgs-1p-CRh" id="XWn-9h-aYM"/>
<outlet property="pullUpGesture" destination="D0R-Cc-rG7" id="v3L-Nf-bIC"/> <outlet property="pullUpGesture" destination="D0R-Cc-rG7" id="v3L-Nf-bIC"/>
<outlet property="pullUpView" destination="dId-fW-MRd" id="JED-fJ-VfH"/> <outlet property="pullUpView" destination="dId-fW-MRd" id="JED-fJ-VfH"/>
<outlet property="searchDelegate" destination="S88-IL-SpJ" id="KoD-Wi-yqs"/>
<outlet property="searchDisplayController" destination="P8c-gf-nN3" id="CLs-YI-7NC"/> <outlet property="searchDisplayController" destination="P8c-gf-nN3" id="CLs-YI-7NC"/>
<outlet property="searchTipContainer" destination="zOR-Du-qRL" id="X7h-Vh-iCE"/> <outlet property="searchTipContainer" destination="zOR-Du-qRL" id="X7h-Vh-iCE"/>
<outlet property="siteName" destination="gSK-aB-wNI" id="IIe-z8-zy8"/> <outlet property="siteName" destination="gSK-aB-wNI" id="IIe-z8-zy8"/>
@ -1093,10 +1105,36 @@ L4m3P4sSw0rD</string>
<placeholder placeholderIdentifier="IBFirstResponder" id="mK2-p1-3zC" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="mK2-p1-3zC" userLabel="First Responder" sceneMemberID="firstResponder"/>
<searchDisplayController searchResultsTitle="" id="P8c-gf-nN3"> <searchDisplayController searchResultsTitle="" id="P8c-gf-nN3">
<connections> <connections>
<outlet property="delegate" destination="S88-IL-SpJ" id="vyb-1H-gV1"/>
<outlet property="searchBar" destination="qeo-n2-WVh" id="bFO-FC-Xdj"/> <outlet property="searchBar" destination="qeo-n2-WVh" id="bFO-FC-Xdj"/>
<outlet property="searchContentsController" destination="PQa-Xl-A3x" id="iEu-t3-hJY"/> <outlet property="searchContentsController" destination="PQa-Xl-A3x" id="iEu-t3-hJY"/>
<outlet property="searchResultsDataSource" destination="S88-IL-SpJ" id="vwd-hZ-dCb"/>
<outlet property="searchResultsDelegate" destination="S88-IL-SpJ" id="62J-00-vq7"/>
</connections> </connections>
</searchDisplayController> </searchDisplayController>
<customObject id="S88-IL-SpJ" customClass="MPElementListSearchController">
<connections>
<outlet property="delegate" destination="PQa-Xl-A3x" id="LLe-ba-wg6"/>
<outlet property="searchDisplayController" destination="P8c-gf-nN3" id="aXE-is-5AO"/>
<outlet property="searchTipContainer" destination="zOR-Du-qRL" id="1Cg-nx-oRl"/>
</connections>
</customObject>
<pongPressGestureRecognizer allowableMovement="10" minimumPressDuration="0.5" id="Frb-Ve-w79" userLabel="Long Press Gesture (reset pw)">
<connections>
<action selector="resetPasswordCounter:" destination="PQa-Xl-A3x" id="Iup-Mu-kTx"/>
</connections>
</pongPressGestureRecognizer>
<pongPressGestureRecognizer allowableMovement="10" minimumPressDuration="0.5" id="SfB-KW-KnA" userLabel="Long Press Gesture (edit username)">
<connections>
<action selector="editLoginName:" destination="PQa-Xl-A3x" id="DNy-7M-ogJ"/>
</connections>
</pongPressGestureRecognizer>
<tapGestureRecognizer id="Qyt-6l-shg" userLabel="Tap Gesture (copy username)">
<connections>
<action selector="copyLoginName:" destination="PQa-Xl-A3x" id="4Kn-O1-Iii"/>
</connections>
</tapGestureRecognizer>
<tapGestureRecognizer id="6vw-jn-qnG" userLabel="Tap Gesture (info outdated)"/>
<panGestureRecognizer minimumNumberOfTouches="1" id="O19-XO-q6s"> <panGestureRecognizer minimumNumberOfTouches="1" id="O19-XO-q6s">
<connections> <connections>
<action selector="panHelpDown:" destination="PQa-Xl-A3x" id="w7M-2J-eqL"/> <action selector="panHelpDown:" destination="PQa-Xl-A3x" id="w7M-2J-eqL"/>
@ -1862,6 +1900,7 @@ If you set a custom password, it will be encrypted before it is saved to the clo
<navigationBar contentMode="scaleToFill" barStyle="black" translucent="NO" id="l0p-Tu-L9k"> <navigationBar contentMode="scaleToFill" barStyle="black" translucent="NO" id="l0p-Tu-L9k">
<rect key="frame" x="0.0" y="20" width="320" height="44"/> <rect key="frame" x="0.0" y="20" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<inset key="insetFor6xAndEarlier" minX="0.0" minY="20" maxX="0.0" maxY="-20"/>
<color key="tintColor" red="0.47450980390000003" green="0.86666666670000003" blue="0.98431372549999996" alpha="1" colorSpace="calibratedRGB"/> <color key="tintColor" red="0.47450980390000003" green="0.86666666670000003" blue="0.98431372549999996" alpha="1" colorSpace="calibratedRGB"/>
<color key="barTintColor" red="0.12549020350000001" green="0.1411764771" blue="0.14901961389999999" alpha="1" colorSpace="calibratedRGB"/> <color key="barTintColor" red="0.12549020350000001" green="0.1411764771" blue="0.14901961389999999" alpha="1" colorSpace="calibratedRGB"/>
<textAttributes key="titleTextAttributes"> <textAttributes key="titleTextAttributes">