2
0

Moved MPSearchDelegate to code.

[FIXED]     Another potential crash because of an over-released
            top-level object in storyboard.
This commit is contained in:
Maarten Billemont 2012-06-27 23:44:37 +02:00
parent 2dba4c87ba
commit d77cde1929
6 changed files with 17 additions and 22 deletions

View File

@ -44,7 +44,7 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
buildConfiguration = "AppStore" buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
allowLocationSimulation = "YES"> allowLocationSimulation = "YES">

View File

@ -9,9 +9,9 @@
#import "MPEntities.h" #import "MPEntities.h"
#define MP_N 131072 #define MP_N 32768
#define MP_r 8 #define MP_r 8
#define MP_p 1 #define MP_p 2
#define MP_dkLen 64 #define MP_dkLen 64
#define MP_hash PearlHashSHA256 #define MP_hash PearlHashSHA256

View File

@ -14,7 +14,8 @@
@interface MPMainViewController : UIViewController<MPTypeDelegate, UITextFieldDelegate, MPSearchResultsDelegate, UIWebViewDelegate, MFMailComposeViewControllerDelegate> @interface MPMainViewController : UIViewController<MPTypeDelegate, UITextFieldDelegate, MPSearchResultsDelegate, UIWebViewDelegate, MFMailComposeViewControllerDelegate>
@property (strong, nonatomic) MPElementEntity *activeElement; @property (strong, nonatomic) MPElementEntity *activeElement;
@property (strong, nonatomic) IBOutlet MPSearchDelegate *searchResultsController; @property (strong, nonatomic) IBOutlet MPSearchDelegate *searchDelegate;
@property (strong, nonatomic) IBOutlet UILongPressGestureRecognizer *resetPasswordCounterGesture;
@property (weak, nonatomic) IBOutlet UITextField *contentField; @property (weak, nonatomic) IBOutlet UITextField *contentField;
@property (weak, nonatomic) IBOutlet UIButton *typeButton; @property (weak, nonatomic) IBOutlet UIButton *typeButton;
@property (weak, nonatomic) IBOutlet UIWebView *helpView; @property (weak, nonatomic) IBOutlet UIWebView *helpView;
@ -33,7 +34,6 @@
@property (weak, nonatomic) IBOutlet UIView *searchTipContainer; @property (weak, nonatomic) IBOutlet UIView *searchTipContainer;
@property (weak, nonatomic) IBOutlet UIView *actionsTipContainer; @property (weak, nonatomic) IBOutlet UIView *actionsTipContainer;
@property (weak, nonatomic) IBOutlet UIView *typeTipContainer; @property (weak, nonatomic) IBOutlet UIView *typeTipContainer;
@property (strong, nonatomic) IBOutlet UILongPressGestureRecognizer *resetPasswordCounterGesture;
@property (copy) void (^contentTipCleanup)(BOOL finished); @property (copy) void (^contentTipCleanup)(BOOL finished);

View File

@ -25,7 +25,7 @@
@implementation MPMainViewController @implementation MPMainViewController
@synthesize activeElement = _activeElement; @synthesize activeElement = _activeElement;
@synthesize searchResultsController = _searchResultsController; @synthesize searchDelegate = _searchDelegate;
@synthesize typeButton = _typeButton; @synthesize typeButton = _typeButton;
@synthesize helpView = _helpView; @synthesize helpView = _helpView;
@synthesize siteName = _siteName; @synthesize siteName = _siteName;
@ -68,6 +68,15 @@
- (void)viewDidLoad { - (void)viewDidLoad {
self.searchDelegate = [MPSearchDelegate 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.resetPasswordCounterGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(resetPasswordCounter:)]; self.resetPasswordCounterGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(resetPasswordCounter:)];
[self.passwordIncrementer addGestureRecognizer:self.resetPasswordCounterGesture]; [self.passwordIncrementer addGestureRecognizer:self.resetPasswordCounterGesture];
@ -136,7 +145,6 @@
[self setContentField:nil]; [self setContentField:nil];
[self setTypeButton:nil]; [self setTypeButton:nil];
[self setSearchResultsController:nil];
[self setHelpView:nil]; [self setHelpView:nil];
[self setSiteName:nil]; [self setSiteName:nil];
[self setPasswordCounter:nil]; [self setPasswordCounter:nil];
@ -153,6 +161,7 @@
[self setSearchTipContainer:nil]; [self setSearchTipContainer:nil];
[self setActionsTipContainer:nil]; [self setActionsTipContainer:nil];
[self setTypeTipContainer:nil]; [self setTypeTipContainer:nil];
[self setSearchDelegate:nil];
[self setResetPasswordCounterGesture:nil]; [self setResetPasswordCounterGesture:nil];
[super viewDidUnload]; [super viewDidUnload];
} }

View File

@ -110,7 +110,6 @@
- (void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller { - (void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller {
dbg(@"Search ended with: %@", controller.searchBar.text);
controller.searchBar.prompt = nil; controller.searchBar.prompt = nil;
controller.searchBar.searchResultsButtonSelected = NO; controller.searchBar.searchResultsButtonSelected = NO;
} }

View File

@ -416,20 +416,10 @@ Your passwords will be AES-encrypted with your master password.</string>
<scene sceneID="U26-Zf-euQ"> <scene sceneID="U26-Zf-euQ">
<objects> <objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="mK2-p1-3zC" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="mK2-p1-3zC" userLabel="First Responder" sceneMemberID="firstResponder"/>
<customObject id="0QO-2P-OhD" customClass="MPSearchDelegate">
<connections>
<outlet property="delegate" destination="PQa-Xl-A3x" id="O2f-mW-ab8"/>
<outlet property="searchDisplayController" destination="P8c-gf-nN3" id="exk-dS-Ui3"/>
<outlet property="searchTipContainer" destination="zOR-Du-qRL" id="lk6-2X-lIb"/>
</connections>
</customObject>
<searchDisplayController id="P8c-gf-nN3"> <searchDisplayController id="P8c-gf-nN3">
<connections> <connections>
<outlet property="delegate" destination="0QO-2P-OhD" id="gst-Hm-5ja"/>
<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="0QO-2P-OhD" id="XJh-rC-kId"/>
<outlet property="searchResultsDelegate" destination="0QO-2P-OhD" id="Bm8-Q3-lLA"/>
</connections> </connections>
</searchDisplayController> </searchDisplayController>
<viewController id="PQa-Xl-A3x" customClass="MPMainViewController" sceneMemberID="viewController"> <viewController id="PQa-Xl-A3x" customClass="MPMainViewController" sceneMemberID="viewController">
@ -621,9 +611,6 @@ L4m3P4sSw0rD</string>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<gestureRecognizers/> <gestureRecognizers/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="URL"/> <textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="URL"/>
<connections>
<outlet property="delegate" destination="0QO-2P-OhD" id="Maj-Iz-6Hb"/>
</connections>
</searchBar> </searchBar>
<view userInteractionEnabled="NO" contentMode="scaleToFill" id="zOR-Du-qRL"> <view userInteractionEnabled="NO" contentMode="scaleToFill" id="zOR-Du-qRL">
<rect key="frame" x="10" y="15" width="300" height="60"/> <rect key="frame" x="10" y="15" width="300" height="60"/>
@ -734,7 +721,6 @@ L4m3P4sSw0rD</string>
<outlet property="passwordEdit" destination="9FS-fS-xH6" id="YeB-HF-ZPk"/> <outlet property="passwordEdit" destination="9FS-fS-xH6" id="YeB-HF-ZPk"/>
<outlet property="passwordIncrementer" destination="jec-mu-nPt" id="i9B-lX-zzX"/> <outlet property="passwordIncrementer" destination="jec-mu-nPt" id="i9B-lX-zzX"/>
<outlet property="searchDisplayController" destination="P8c-gf-nN3" id="CLs-YI-7NC"/> <outlet property="searchDisplayController" destination="P8c-gf-nN3" id="CLs-YI-7NC"/>
<outlet property="searchResultsController" destination="0QO-2P-OhD" id="xEC-gV-lHp"/>
<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"/>
<outlet property="typeButton" destination="Cei-5z-uWE" id="4M1-d7-5Bh"/> <outlet property="typeButton" destination="Cei-5z-uWE" id="4M1-d7-5Bh"/>
@ -1379,6 +1365,7 @@ L4m3P4sSw0rD</string>
<relationship kind="outlet" name="passwordEdit" candidateClass="UIButton"/> <relationship kind="outlet" name="passwordEdit" candidateClass="UIButton"/>
<relationship kind="outlet" name="passwordIncrementer" candidateClass="UIButton"/> <relationship kind="outlet" name="passwordIncrementer" candidateClass="UIButton"/>
<relationship kind="outlet" name="resetPasswordCounterGesture" candidateClass="UILongPressGestureRecognizer"/> <relationship kind="outlet" name="resetPasswordCounterGesture" candidateClass="UILongPressGestureRecognizer"/>
<relationship kind="outlet" name="searchDelegate" candidateClass="MPSearchDelegate"/>
<relationship kind="outlet" name="searchResultsController" candidateClass="MPSearchDelegate"/> <relationship kind="outlet" name="searchResultsController" candidateClass="MPSearchDelegate"/>
<relationship kind="outlet" name="searchTipContainer" candidateClass="UIView"/> <relationship kind="outlet" name="searchTipContainer" candidateClass="UIView"/>
<relationship kind="outlet" name="siteName" candidateClass="UILabel"/> <relationship kind="outlet" name="siteName" candidateClass="UILabel"/>