diff --git a/PasswordGenerator.h b/PasswordGenerator.h index 0260ced..c94e53f 100644 --- a/PasswordGenerator.h +++ b/PasswordGenerator.h @@ -24,7 +24,7 @@ @protocol PasswordGenerator @property size_t length; -@property (copy) OFString *site; +@property (nonatomic, copy) OFString *site; @property const char *passphrase; @property (readonly) unsigned char *output; diff --git a/iOS/AboutController.h b/iOS/AboutController.h index 9a783d0..0c161ef 100644 --- a/iOS/AboutController.h +++ b/iOS/AboutController.h @@ -23,5 +23,5 @@ @import UIKit; @interface AboutController: UIViewController -@property (retain, nonatomic) IBOutlet UIWebView *webView; +@property (nonatomic, retain) IBOutlet UIWebView *webView; @end diff --git a/iOS/AboutController.m b/iOS/AboutController.m index 5fb0676..95cff4f 100644 --- a/iOS/AboutController.m +++ b/iOS/AboutController.m @@ -80,8 +80,8 @@ static NSString *aboutHTMLTemplate = [super dealloc]; } -- (BOOL)webView: (UIWebView*)webView - shouldStartLoadWithRequest: (NSURLRequest*)request +- (BOOL)webView: (UIWebView *)webView + shouldStartLoadWithRequest: (NSURLRequest *)request navigationType: (UIWebViewNavigationType)navigationType { if (navigationType == UIWebViewNavigationTypeLinkClicked) { diff --git a/iOS/AddSiteController.h b/iOS/AddSiteController.h index aecd545..21a139d 100644 --- a/iOS/AddSiteController.h +++ b/iOS/AddSiteController.h @@ -25,9 +25,9 @@ #import "MainViewController.h" @interface AddSiteController: UITableViewController -@property (retain, nonatomic) IBOutlet UITextField *nameField; -@property (retain, nonatomic) IBOutlet UITextField *lengthField; -@property (retain, nonatomic) IBOutlet UISwitch *legacySwitch; +@property (nonatomic, retain) IBOutlet UITextField *nameField; +@property (nonatomic, retain) IBOutlet UITextField *lengthField; +@property (nonatomic, retain) IBOutlet UISwitch *legacySwitch; @property (retain) MainViewController *mainViewController; - (IBAction)done: (id)sender; diff --git a/iOS/AppDelegate.h b/iOS/AppDelegate.h index d6926e4..e6cab2f 100644 --- a/iOS/AppDelegate.h +++ b/iOS/AppDelegate.h @@ -23,5 +23,5 @@ @import UIKit; @interface AppDelegate: UIResponder -@property (strong, nonatomic) UIWindow *window; +@property (nonatomic, strong) UIWindow *window; @end diff --git a/iOS/MainViewController.h b/iOS/MainViewController.h index 5ddf847..4f19099 100644 --- a/iOS/MainViewController.h +++ b/iOS/MainViewController.h @@ -27,5 +27,5 @@ @interface MainViewController: UIViewController @property (retain) SiteStorage *siteStorage; -@property (retain, nonatomic) IBOutlet UITableView *tableView; +@property (nonatomic, retain) IBOutlet UITableView *tableView; @end diff --git a/iOS/MainViewController.m b/iOS/MainViewController.m index 01ec3ae..10f5399 100644 --- a/iOS/MainViewController.m +++ b/iOS/MainViewController.m @@ -41,14 +41,14 @@ [super dealloc]; } -- (NSInteger)tableView: (UITableView*)tableView +- (NSInteger)tableView: (UITableView *)tableView numberOfRowsInSection: (NSInteger)section { return [self.siteStorage sitesCount]; } -- (UITableViewCell*)tableView: (UITableView*)tableView - cellForRowAtIndexPath: (NSIndexPath*)indexPath +- (UITableViewCell *)tableView: (UITableView *)tableView + cellForRowAtIndexPath: (NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: @"site"]; @@ -63,14 +63,14 @@ return cell; } -- (void)tableView: (UITableView*)tableView - didSelectRowAtIndexPath: (NSIndexPath*)indexPath +- (void)tableView: (UITableView *)tableView + didSelectRowAtIndexPath: (NSIndexPath *)indexPath { [self performSegueWithIdentifier: @"showDetails" sender: self]; } -- (void)prepareForSegue: (UIStoryboardSegue*)segue +- (void)prepareForSegue: (UIStoryboardSegue *)segue sender: (id)sender { if ([segue.identifier isEqual: @"addSite"] || diff --git a/iOS/ShowDetailsController.m b/iOS/ShowDetailsController.m index 3c020e1..68f3678 100644 --- a/iOS/ShowDetailsController.m +++ b/iOS/ShowDetailsController.m @@ -31,7 +31,7 @@ #import "LegacyPasswordGenerator.h" @interface ShowDetailsController () -- (void)_generateWithCallback: (void(^)(NSMutableString*))block; +- (void)_generateWithCallback: (void (^)(NSMutableString *))block; - (void)_generateAndCopy; - (void)_generateAndShow; @end @@ -86,14 +86,14 @@ clearNSMutableString(NSMutableString *string) [self.passphraseField becomeFirstResponder]; } -- (BOOL)textFieldShouldReturn: (UITextField*)textField +- (BOOL)textFieldShouldReturn: (UITextField *)textField { [textField resignFirstResponder]; return NO; } -- (void)tableView: (UITableView*)tableView - didSelectRowAtIndexPath: (NSIndexPath*)indexPath +- (void)tableView: (UITableView *)tableView + didSelectRowAtIndexPath: (NSIndexPath *)indexPath { [self.passphraseField resignFirstResponder]; [tableView deselectRowAtIndexPath: indexPath @@ -161,7 +161,7 @@ clearNSMutableString(NSMutableString *string) }]; } -- (void)_generateWithCallback: (void(^)(NSMutableString*))block +- (void)_generateWithCallback: (void (^)(NSMutableString *))block { UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName: @"Main" @@ -195,9 +195,9 @@ clearNSMutableString(NSMutableString *string) } NSMutableString *password = [NSMutableString - stringWithUTF8String: (char*)generator.output]; + stringWithUTF8String: (char *)generator.output]; of_explicit_memset(generator.output, 0, - strlen((char*)generator.output)); + strlen((char *)generator.output)); activityController.view.hidden = YES; block(password); diff --git a/iOS/SiteStorage.h b/iOS/SiteStorage.h index 57e2cba..8b16790 100644 --- a/iOS/SiteStorage.h +++ b/iOS/SiteStorage.h @@ -25,18 +25,19 @@ @interface SiteStorage: OFObject { OFString *_path; - OFMutableDictionary *> + OFMutableDictionary *> *_storage; OFArray *_sites; } -- (OFArray*)sites; +@property (readonly, nonatomic) OFArray *sites; + - (size_t)sitesCount; -- (bool)hasSite: (OFString*)name; -- (size_t)lengthForSite: (OFString*)name; -- (bool)isSiteLegacy: (OFString*)name; -- (void)setSite: (OFString*)site +- (bool)hasSite: (OFString *)name; +- (size_t)lengthForSite: (OFString *)name; +- (bool)isSiteLegacy: (OFString *)name; +- (void)setSite: (OFString *)site length: (size_t)length legacy: (bool)legacy; -- (void)removeSite: (OFString*)name; +- (void)removeSite: (OFString *)name; @end diff --git a/iOS/SiteStorage.m b/iOS/SiteStorage.m index 1d39b62..b771869 100644 --- a/iOS/SiteStorage.m +++ b/iOS/SiteStorage.m @@ -84,7 +84,7 @@ static OFNumber *lengthField, *legacyField; [super dealloc]; } -- (OFArray*)sites +- (OFArray *)sites { void *pool = objc_autoreleasePoolPush(); OFArray *sites = [[_storage allKeys] sortedArray]; @@ -99,12 +99,12 @@ static OFNumber *lengthField, *legacyField; return [_storage count]; } -- (bool)hasSite: (OFString*)name +- (bool)hasSite: (OFString *)name { return (_storage[name] != nil); } -- (size_t)lengthForSite: (OFString*)name +- (size_t)lengthForSite: (OFString *)name { OFDictionary *site = _storage[name]; @@ -114,7 +114,7 @@ static OFNumber *lengthField, *legacyField; return [site[lengthField] sizeValue]; } -- (bool)isSiteLegacy: (OFString*)name +- (bool)isSiteLegacy: (OFString *)name { OFDictionary *site = _storage[name]; @@ -124,7 +124,7 @@ static OFNumber *lengthField, *legacyField; return [site[legacyField] boolValue]; } -- (void)setSite: (OFString*)site +- (void)setSite: (OFString *)site length: (size_t)length legacy: (bool)legacy { @@ -139,7 +139,7 @@ static OFNumber *lengthField, *legacyField; objc_autoreleasePoolPop(pool); } -- (void)removeSite: (OFString*)name +- (void)removeSite: (OFString *)name { [_storage removeObjectForKey: name]; [self _update]; diff --git a/iOS/scrypt-pwgen.xcodeproj/project.pbxproj b/iOS/scrypt-pwgen.xcodeproj/project.pbxproj index 2a2acb4..e1a1fde 100644 --- a/iOS/scrypt-pwgen.xcodeproj/project.pbxproj +++ b/iOS/scrypt-pwgen.xcodeproj/project.pbxproj @@ -362,7 +362,7 @@ ); INFOPLIST_FILE = Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen"; + PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen.ios"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -380,7 +380,7 @@ ); INFOPLIST_FILE = Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen"; + PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen.ios"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release;