mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-24 20:20:51 +00:00
Convert to ARC
This commit is contained in:
parent
dfcc124f1c
commit
a14fa23f28
@ -36,6 +36,6 @@
|
||||
@property (nonatomic, copy) NSString *headerLabel;
|
||||
@property (nonatomic, copy) NSString *middleHeaderLabel;
|
||||
@property (nonatomic, copy) NSString *subHeaderLabel;
|
||||
@property (nonatomic, retain) UIImage *iconImage;
|
||||
@property (nonatomic, strong) UIImage *iconImage;
|
||||
|
||||
@end
|
||||
|
@ -56,15 +56,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_headerLabel release], _headerLabel = nil;
|
||||
[_middleHeaderLabel release], _middleHeaderLabel = nil;
|
||||
[_subHeaderLabel release], _subHeaderLabel = nil;
|
||||
[_iconImage release], _iconImage = nil;;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIView
|
||||
|
||||
@ -75,7 +66,7 @@
|
||||
|
||||
// draw the gradient
|
||||
NSArray *colors = [NSArray arrayWithObjects:(id)kDarkGrayColor.CGColor, (id)kLightGrayColor.CGColor, nil];
|
||||
CGGradientRef gradient = CGGradientCreateWithColors(CGColorGetColorSpace((CGColorRef)[colors objectAtIndex:0]), (CFArrayRef)colors, (CGFloat[2]){0, 1});
|
||||
CGGradientRef gradient = CGGradientCreateWithColors(CGColorGetColorSpace((__bridge CGColorRef)[colors objectAtIndex:0]), (__bridge CFArrayRef)colors, (CGFloat[2]){0, 1});
|
||||
CGPoint top = CGPointMake(CGRectGetMidX(bounds), bounds.size.height - 3);
|
||||
CGPoint bottom = CGPointMake(CGRectGetMidX(bounds), CGRectGetMaxY(bounds));
|
||||
CGContextDrawLinearGradient(context, gradient, top, bottom, 0);
|
||||
@ -108,7 +99,6 @@
|
||||
|
||||
- (void)setHeaderLabel:(NSString *)anHeaderLabel {
|
||||
if (_headerLabel != anHeaderLabel) {
|
||||
[_headerLabel release];
|
||||
_headerLabel = [anHeaderLabel copy];
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
@ -116,7 +106,6 @@
|
||||
|
||||
- (void)setMiddleHeaderLabel:(NSString *)aMiddleHeaderLabel {
|
||||
if (_middleHeaderLabel != aMiddleHeaderLabel) {
|
||||
[_middleHeaderLabel release];
|
||||
_middleHeaderLabel = [aMiddleHeaderLabel copy];
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
@ -124,7 +113,6 @@
|
||||
|
||||
- (void)setSubHeaderLabel:(NSString *)aSubHeaderLabel {
|
||||
if (_subHeaderLabel != aSubHeaderLabel) {
|
||||
[_subHeaderLabel release];
|
||||
_subHeaderLabel = [aSubHeaderLabel copy];
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
@ -132,11 +120,10 @@
|
||||
|
||||
- (void)setIconImage:(UIImage *)anIconImage {
|
||||
if (_iconImage != anIconImage) {
|
||||
[_iconImage release];
|
||||
|
||||
// scale, make borders and reflection
|
||||
_iconImage = bit_imageToFitSize(anIconImage, CGSizeMake(kImageHeight, kImageHeight), YES);
|
||||
_iconImage = [bit_roundedCornerImage(_iconImage, kImageBorderRadius, 0.0) retain];
|
||||
_iconImage = bit_roundedCornerImage(_iconImage, kImageBorderRadius, 0.0);
|
||||
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
@ -45,7 +45,7 @@
|
||||
#pragma mark - Static
|
||||
|
||||
+ (BITAppVersionMetaInfo *)appVersionMetaInfoFromDict:(NSDictionary *)dict {
|
||||
BITAppVersionMetaInfo *appVersionMetaInfo = [[[[self class] alloc] init] autorelease];
|
||||
BITAppVersionMetaInfo *appVersionMetaInfo = [[[self class] alloc] init];
|
||||
|
||||
if ([dict isKindOfClass:[NSDictionary class]]) {
|
||||
appVersionMetaInfo.name = [dict objectForKey:@"title"];
|
||||
@ -63,17 +63,6 @@
|
||||
|
||||
#pragma mark - NSObject
|
||||
|
||||
- (void)dealloc {
|
||||
[_name release];
|
||||
[_version release];
|
||||
[_shortVersion release];
|
||||
[_notes release];
|
||||
[_date release];
|
||||
[_size release];
|
||||
[_mandatory release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)other {
|
||||
if (other == self)
|
||||
@ -144,7 +133,7 @@
|
||||
}
|
||||
|
||||
- (NSString *)dateString {
|
||||
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
[formatter setDateStyle:NSDateFormatterMediumStyle];
|
||||
|
||||
return [formatter stringFromDate:self.date];
|
||||
|
@ -86,7 +86,7 @@ static NSString *kBITCrashManagerStatus = @"BITCrashManagerStatus";
|
||||
/**
|
||||
Sets the optional `BITCrashManagerDelegate` delegate.
|
||||
*/
|
||||
@property (nonatomic, assign) id delegate;
|
||||
@property (nonatomic, weak) id delegate;
|
||||
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
|
@ -54,7 +54,7 @@
|
||||
|
||||
@interface BITCrashManager ()
|
||||
|
||||
@property (nonatomic, retain) NSFileManager *fileManager;
|
||||
@property (nonatomic, strong) NSFileManager *fileManager;
|
||||
|
||||
@end
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
|
||||
// temporary directory for crashes grabbed from PLCrashReporter
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
||||
_crashesDir = [[[paths objectAtIndex:0] stringByAppendingPathComponent:BITHOCKEY_IDENTIFIER] retain];
|
||||
_crashesDir = [[paths objectAtIndex:0] stringByAppendingPathComponent:BITHOCKEY_IDENTIFIER];
|
||||
|
||||
if (![self.fileManager fileExistsAtPath:_crashesDir]) {
|
||||
NSDictionary *attributes = [NSDictionary dictionaryWithObject: [NSNumber numberWithUnsignedLong: 0755] forKey: NSFilePosixPermissions];
|
||||
@ -127,8 +127,8 @@
|
||||
[self.fileManager createDirectoryAtPath:_crashesDir withIntermediateDirectories: YES attributes: attributes error: &theError];
|
||||
}
|
||||
|
||||
_settingsFile = [[_crashesDir stringByAppendingPathComponent:BITHOCKEY_CRASH_SETTINGS] retain];
|
||||
_analyzerInProgressFile = [[_crashesDir stringByAppendingPathComponent:BITHOCKEY_CRASH_ANALYZER] retain];
|
||||
_settingsFile = [_crashesDir stringByAppendingPathComponent:BITHOCKEY_CRASH_SETTINGS];
|
||||
_analyzerInProgressFile = [_crashesDir stringByAppendingPathComponent:BITHOCKEY_CRASH_ANALYZER];
|
||||
|
||||
if ([_fileManager fileExistsAtPath:_analyzerInProgressFile]) {
|
||||
NSError *error = nil;
|
||||
@ -146,26 +146,9 @@
|
||||
|
||||
|
||||
- (void) dealloc {
|
||||
_delegate = nil;
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:BITHockeyNetworkDidBecomeReachableNotification object:nil];
|
||||
|
||||
[_urlConnection cancel];
|
||||
[_urlConnection release];
|
||||
_urlConnection = nil;
|
||||
|
||||
[_crashesDir release];
|
||||
[_crashFiles release];
|
||||
|
||||
[_fileManager release];
|
||||
_fileManager = nil;
|
||||
|
||||
[_approvedCrashReports release];
|
||||
_approvedCrashReports = nil;
|
||||
|
||||
[_analyzerInProgressFile release];
|
||||
_analyzerInProgressFile = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@ -324,7 +307,7 @@
|
||||
[self saveSettings];
|
||||
|
||||
// Try loading the crash report
|
||||
NSData *crashData = [[[NSData alloc] initWithData:[crashReporter loadPendingCrashReportDataAndReturnError: &error]] autorelease];
|
||||
NSData *crashData = [[NSData alloc] initWithData:[crashReporter loadPendingCrashReportDataAndReturnError: &error]];
|
||||
|
||||
NSString *cacheFilename = [NSString stringWithFormat: @"%.0f", [NSDate timeIntervalSinceReferenceDate]];
|
||||
|
||||
@ -357,7 +340,7 @@
|
||||
}
|
||||
|
||||
// get the startup timestamp from the crash report, and the file timestamp to calculate the timeinterval when the crash happened after startup
|
||||
PLCrashReport *report = [[[PLCrashReport alloc] initWithData:crashData error:&error] autorelease];
|
||||
PLCrashReport *report = [[PLCrashReport alloc] initWithData:crashData error:&error];
|
||||
|
||||
if ([report.applicationInfo respondsToSelector:@selector(applicationStartupTimestamp)]) {
|
||||
if (report.systemInfo.timestamp && report.applicationInfo.applicationStartupTimestamp) {
|
||||
@ -471,7 +454,6 @@
|
||||
}
|
||||
|
||||
[alertView show];
|
||||
[alertView release];
|
||||
} else {
|
||||
[self sendCrashReports];
|
||||
}
|
||||
@ -559,7 +541,7 @@
|
||||
NSData *crashData = [NSData dataWithContentsOfFile:filename];
|
||||
|
||||
if ([crashData length] > 0) {
|
||||
PLCrashReport *report = [[[PLCrashReport alloc] initWithData:crashData error:&error] autorelease];
|
||||
PLCrashReport *report = [[PLCrashReport alloc] initWithData:crashData error:&error];
|
||||
|
||||
if (report == nil) {
|
||||
BITHockeyLog(@"WARNING: Could not parse crash report");
|
||||
@ -754,9 +736,7 @@
|
||||
|
||||
_sendingInProgress = NO;
|
||||
|
||||
[_responseData release];
|
||||
_responseData = nil;
|
||||
[_urlConnection release];
|
||||
_urlConnection = nil;
|
||||
}
|
||||
|
||||
@ -808,9 +788,7 @@
|
||||
|
||||
_sendingInProgress = NO;
|
||||
|
||||
[_responseData release];
|
||||
_responseData = nil;
|
||||
[_urlConnection release];
|
||||
_urlConnection = nil;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
@see customActivityTitle
|
||||
*/
|
||||
@property (nonatomic, retain) UIImage *customActivityImage;
|
||||
@property (nonatomic, strong) UIImage *customActivityImage;
|
||||
|
||||
|
||||
/**
|
||||
@ -50,6 +50,6 @@
|
||||
|
||||
@see customActivityImage
|
||||
*/
|
||||
@property (nonatomic, retain) NSString *customActivityTitle;
|
||||
@property (nonatomic, strong) NSString *customActivityTitle;
|
||||
|
||||
@end
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
@interface BITFeedbackActivity()
|
||||
|
||||
@property (nonatomic, retain) NSMutableArray *items;
|
||||
@property (nonatomic, strong) NSMutableArray *items;
|
||||
|
||||
@end
|
||||
|
||||
@ -36,14 +36,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_items release]; _items = nil;
|
||||
|
||||
[_customActivityImage release];
|
||||
[_customActivityTitle release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIActivity
|
||||
@ -99,7 +91,7 @@
|
||||
composeViewController.delegate = self;
|
||||
[composeViewController prepareWithItems:_items];
|
||||
|
||||
UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController: composeViewController] autorelease];
|
||||
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: composeViewController];
|
||||
navController.modalPresentationStyle = UIModalPresentationFormSheet;
|
||||
navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
application, it is _REQUIRED_ to set this delegate and implement
|
||||
`[BITUpdateManagerDelegate customDeviceIdentifierForUpdateManager:]`!
|
||||
*/
|
||||
@property (nonatomic, assign) id<BITFeedbackComposeViewControllerDelegate> delegate;
|
||||
@property (nonatomic, weak) id<BITFeedbackComposeViewControllerDelegate> delegate;
|
||||
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
|
@ -39,10 +39,10 @@
|
||||
|
||||
@interface BITFeedbackComposeViewController () <BITFeedbackUserDataDelegate>
|
||||
|
||||
@property (nonatomic, assign) BITFeedbackManager *manager;
|
||||
@property (nonatomic, retain) UITextView *textView;
|
||||
@property (nonatomic, weak) BITFeedbackManager *manager;
|
||||
@property (nonatomic, strong) UITextView *textView;
|
||||
|
||||
@property (nonatomic, retain) NSString *text;
|
||||
@property (nonatomic, strong) NSString *text;
|
||||
|
||||
- (void)setUserDataAction;
|
||||
|
||||
@ -70,13 +70,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_text release];
|
||||
[_textView release], _textView = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Public
|
||||
|
||||
@ -141,17 +134,17 @@
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
|
||||
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
|
||||
target:self
|
||||
action:@selector(dismissAction:)] autorelease];
|
||||
action:@selector(dismissAction:)];
|
||||
|
||||
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeSend")
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeSend")
|
||||
style:UIBarButtonItemStyleDone
|
||||
target:self
|
||||
action:@selector(sendAction:)] autorelease];
|
||||
action:@selector(sendAction:)];
|
||||
|
||||
// message input textfield
|
||||
self.textView = [[[UITextView alloc] initWithFrame:self.view.frame] autorelease];
|
||||
self.textView = [[UITextView alloc] initWithFrame:self.view.frame];
|
||||
self.textView.font = [UIFont systemFontOfSize:17];
|
||||
self.textView.delegate = self;
|
||||
self.textView.backgroundColor = [UIColor whiteColor];
|
||||
@ -231,10 +224,10 @@
|
||||
}
|
||||
|
||||
- (void)setUserDataAction {
|
||||
BITFeedbackUserDataViewController *userController = [[[BITFeedbackUserDataViewController alloc] initWithStyle:UITableViewStyleGrouped] autorelease];
|
||||
BITFeedbackUserDataViewController *userController = [[BITFeedbackUserDataViewController alloc] initWithStyle:UITableViewStyleGrouped];
|
||||
userController.delegate = self;
|
||||
|
||||
UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:userController] autorelease];
|
||||
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:userController];
|
||||
|
||||
[self.navigationController presentModalViewController:navController animated:YES];
|
||||
}
|
||||
|
@ -38,11 +38,11 @@ typedef enum {
|
||||
|
||||
@interface BITFeedbackListViewCell : UITableViewCell
|
||||
|
||||
@property (nonatomic, retain) BITFeedbackMessage *message;
|
||||
@property (nonatomic, strong) BITFeedbackMessage *message;
|
||||
|
||||
@property (nonatomic) BITFeedbackListViewCellBackgroundStyle backgroundStyle;
|
||||
|
||||
@property (nonatomic, retain) BITAttributedLabel *labelText;
|
||||
@property (nonatomic, strong) BITAttributedLabel *labelText;
|
||||
|
||||
+ (CGFloat) heightForRowWithMessage:(BITFeedbackMessage *)message tableViewWidth:(CGFloat)width;
|
||||
|
||||
|
@ -53,10 +53,10 @@
|
||||
|
||||
@interface BITFeedbackListViewCell ()
|
||||
|
||||
@property (nonatomic, retain) NSDateFormatter *dateFormatter;
|
||||
@property (nonatomic, retain) NSDateFormatter *timeFormatter;
|
||||
@property (nonatomic, strong) NSDateFormatter *dateFormatter;
|
||||
@property (nonatomic, strong) NSDateFormatter *timeFormatter;
|
||||
|
||||
@property (nonatomic, retain) UILabel *labelTitle;
|
||||
@property (nonatomic, strong) UILabel *labelTitle;
|
||||
|
||||
@end
|
||||
|
||||
@ -72,22 +72,22 @@
|
||||
|
||||
_message = nil;
|
||||
|
||||
self.dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
|
||||
self.dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[self.dateFormatter setTimeStyle:NSDateFormatterNoStyle];
|
||||
[self.dateFormatter setDateStyle:NSDateFormatterMediumStyle];
|
||||
[self.dateFormatter setLocale:[NSLocale currentLocale]];
|
||||
[self.dateFormatter setDoesRelativeDateFormatting:YES];
|
||||
|
||||
self.timeFormatter = [[[NSDateFormatter alloc] init] autorelease];
|
||||
self.timeFormatter = [[NSDateFormatter alloc] init];
|
||||
[self.timeFormatter setTimeStyle:NSDateFormatterShortStyle];
|
||||
[self.timeFormatter setDateStyle:NSDateFormatterNoStyle];
|
||||
[self.timeFormatter setLocale:[NSLocale currentLocale]];
|
||||
[self.timeFormatter setDoesRelativeDateFormatting:YES];
|
||||
|
||||
self.labelTitle = [[[UILabel alloc] init] autorelease];
|
||||
self.labelTitle = [[UILabel alloc] init];
|
||||
self.labelTitle.font = [UIFont systemFontOfSize:TITLE_FONTSIZE];
|
||||
|
||||
self.labelText = [[[BITAttributedLabel alloc] init] autorelease];
|
||||
self.labelText = [[BITAttributedLabel alloc] init];
|
||||
self.labelText.font = [UIFont systemFontOfSize:TEXT_FONTSIZE];
|
||||
self.labelText.numberOfLines = 0;
|
||||
self.labelText.textAlignment = UITextAlignmentLeft;
|
||||
@ -96,18 +96,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_dateFormatter release], _dateFormatter = nil;
|
||||
[_timeFormatter release], _timeFormatter = nil;
|
||||
|
||||
[_labelTitle release], _labelTitle = nil;
|
||||
[_labelText release], _labelText = nil;
|
||||
|
||||
[_message release], _message = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
@ -133,7 +121,7 @@
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
UIView *accessoryViewBackground = [[[UIView alloc] initWithFrame:CGRectMake(0, 2, self.frame.size.width * 2, self.frame.size.height - 2)] autorelease];
|
||||
UIView *accessoryViewBackground = [[UIView alloc] initWithFrame:CGRectMake(0, 2, self.frame.size.width * 2, self.frame.size.height - 2)];
|
||||
accessoryViewBackground.autoresizingMask = UIViewAutoresizingFlexibleHeight;
|
||||
accessoryViewBackground.clipsToBounds = YES;
|
||||
|
||||
|
@ -60,8 +60,8 @@
|
||||
|
||||
@interface BITFeedbackListViewController () <BITFeedbackUserDataDelegate, BITAttributedLabelDelegate>
|
||||
|
||||
@property (nonatomic, assign) BITFeedbackManager *manager;
|
||||
@property (nonatomic, retain) NSDateFormatter *lastUpdateDateFormatter;
|
||||
@property (nonatomic, weak) BITFeedbackManager *manager;
|
||||
@property (nonatomic, strong) NSDateFormatter *lastUpdateDateFormatter;
|
||||
|
||||
@end
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
_deleteButtonSection = -1;
|
||||
_userButtonSection = -1;
|
||||
|
||||
self.lastUpdateDateFormatter = [[[NSDateFormatter alloc] init] autorelease];
|
||||
self.lastUpdateDateFormatter = [[NSDateFormatter alloc] init];
|
||||
[self.lastUpdateDateFormatter setDateStyle:NSDateFormatterShortStyle];
|
||||
[self.lastUpdateDateFormatter setTimeStyle:NSDateFormatterShortStyle];
|
||||
self.lastUpdateDateFormatter.locale = [NSLocale currentLocale];
|
||||
@ -91,9 +91,7 @@
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:BITHockeyFeedbackMessagesLoadingStarted object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:BITHockeyFeedbackMessagesLoadingFinished object:nil];
|
||||
|
||||
[_lastUpdateDateFormatter release]; _lastUpdateDateFormatter = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@ -125,12 +123,12 @@
|
||||
|
||||
id refreshClass = NSClassFromString(@"UIRefreshControl");
|
||||
if (refreshClass) {
|
||||
self.refreshControl = [[[UIRefreshControl alloc] init] autorelease];
|
||||
self.refreshControl = [[UIRefreshControl alloc] init];
|
||||
[self.refreshControl addTarget:self action:@selector(reloadList) forControlEvents:UIControlEventValueChanged];
|
||||
} else {
|
||||
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
|
||||
target:self
|
||||
action:@selector(reloadList)] autorelease];
|
||||
action:@selector(reloadList)];
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,19 +197,19 @@
|
||||
#pragma mark - Private methods
|
||||
|
||||
- (void)setUserDataAction:(id)sender {
|
||||
BITFeedbackUserDataViewController *userController = [[[BITFeedbackUserDataViewController alloc] initWithStyle:UITableViewStyleGrouped] autorelease];
|
||||
BITFeedbackUserDataViewController *userController = [[BITFeedbackUserDataViewController alloc] initWithStyle:UITableViewStyleGrouped];
|
||||
userController.delegate = self;
|
||||
|
||||
UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:userController] autorelease];
|
||||
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:userController];
|
||||
navController.modalPresentationStyle = UIModalPresentationFormSheet;
|
||||
|
||||
[self presentViewController:navController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)newFeedbackAction:(id)sender {
|
||||
BITFeedbackComposeViewController *composeController = [[[BITFeedbackComposeViewController alloc] init] autorelease];
|
||||
BITFeedbackComposeViewController *composeController = [[BITFeedbackComposeViewController alloc] init];
|
||||
|
||||
UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:composeController] autorelease];
|
||||
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:composeController];
|
||||
navController.modalPresentationStyle = UIModalPresentationFormSheet;
|
||||
|
||||
[self presentViewController:navController animated:YES completion:nil];
|
||||
@ -233,7 +231,6 @@
|
||||
[deleteAction setTag:0];
|
||||
[deleteAction setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
|
||||
[deleteAction showInView:self.view];
|
||||
[deleteAction release];
|
||||
} else {
|
||||
UIAlertView *deleteAction = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListButonDeleteAllMessages")
|
||||
message:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllTitle")
|
||||
@ -243,7 +240,6 @@
|
||||
|
||||
[deleteAction setTag:0];
|
||||
[deleteAction show];
|
||||
[deleteAction release];
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,7 +308,7 @@
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:LastUpdateIdentifier];
|
||||
|
||||
if (!cell) {
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:LastUpdateIdentifier] autorelease];
|
||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:LastUpdateIdentifier];
|
||||
cell.textLabel.font = [UIFont systemFontOfSize:10];
|
||||
cell.textLabel.textColor = DEFAULT_TEXTCOLOR;
|
||||
cell.accessoryType = UITableViewCellAccessoryNone;
|
||||
@ -342,7 +338,7 @@
|
||||
cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
||||
|
||||
if (!cell) {
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
|
||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
|
||||
|
||||
cell.textLabel.font = [UIFont systemFontOfSize:14];
|
||||
cell.textLabel.numberOfLines = 0;
|
||||
@ -404,7 +400,7 @@
|
||||
|
||||
// status label or shadow lines
|
||||
if (indexPath.section == 0) {
|
||||
UILabel *statusLabel = [[[UILabel alloc] initWithFrame:CGRectMake(0, 6, cell.frame.size.width, 28)] autorelease];
|
||||
UILabel *statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 6, cell.frame.size.width, 28)];
|
||||
|
||||
statusLabel.font = [UIFont systemFontOfSize:10];
|
||||
statusLabel.textColor = DEFAULT_TEXTCOLOR;
|
||||
@ -417,7 +413,7 @@
|
||||
|
||||
[cell addSubview:statusLabel];
|
||||
} else if (indexPath.section == 2) {
|
||||
UIView *lineView1 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, cell.frame.size.width, 1)] autorelease];
|
||||
UIView *lineView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, cell.frame.size.width, 1)];
|
||||
lineView1.backgroundColor = BORDER_COLOR;
|
||||
lineView1.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
[cell addSubview:lineView1];
|
||||
@ -428,7 +424,7 @@
|
||||
BITFeedbackListViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||
|
||||
if (!cell) {
|
||||
cell = [[[BITFeedbackListViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
|
||||
cell = [[BITFeedbackListViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
|
||||
cell.accessoryType = UITableViewCellAccessoryNone;
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
}
|
||||
@ -444,7 +440,7 @@
|
||||
cell.labelText.delegate = self;
|
||||
cell.labelText.userInteractionEnabled = YES;
|
||||
|
||||
UIView *lineView1 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, cell.frame.size.width, 1)] autorelease];
|
||||
UIView *lineView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, cell.frame.size.width, 1)];
|
||||
lineView1.backgroundColor = BORDER_COLOR;
|
||||
lineView1.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
[cell addSubview:lineView1];
|
||||
@ -504,7 +500,6 @@
|
||||
[linkAction setTag:1];
|
||||
[linkAction setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
|
||||
[linkAction showInView:self.view];
|
||||
[linkAction release];
|
||||
} else {
|
||||
UIAlertView *linkAction = [[UIAlertView alloc] initWithTitle:[url absoluteString]
|
||||
message:nil
|
||||
@ -515,7 +510,6 @@
|
||||
|
||||
[linkAction setTag:1];
|
||||
[linkAction show];
|
||||
[linkAction release];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@
|
||||
|
||||
// temporary directory for crashes grabbed from PLCrashReporter
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
||||
_feedbackDir = [[[paths objectAtIndex:0] stringByAppendingPathComponent:BITHOCKEY_IDENTIFIER] retain];
|
||||
_feedbackDir = [[paths objectAtIndex:0] stringByAppendingPathComponent:BITHOCKEY_IDENTIFIER];
|
||||
|
||||
if (![_fileManager fileExistsAtPath:_feedbackDir]) {
|
||||
NSDictionary *attributes = [NSDictionary dictionaryWithObject: [NSNumber numberWithUnsignedLong: 0755] forKey: NSFilePosixPermissions];
|
||||
@ -95,7 +95,7 @@
|
||||
[_fileManager createDirectoryAtPath:_feedbackDir withIntermediateDirectories: YES attributes: attributes error: &theError];
|
||||
}
|
||||
|
||||
_settingsFile = [[_feedbackDir stringByAppendingPathComponent:BITHOCKEY_FEEDBACK_SETTINGS] retain];
|
||||
_settingsFile = [_feedbackDir stringByAppendingPathComponent:BITHOCKEY_FEEDBACK_SETTINGS];
|
||||
|
||||
_userID = nil;
|
||||
_userName = nil;
|
||||
@ -108,24 +108,6 @@
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:BITHockeyNetworkDidBecomeReachableNotification object:nil];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
|
||||
|
||||
[_currentFeedbackListViewController release], _currentFeedbackListViewController = nil;
|
||||
[_currentFeedbackComposeViewController release], _currentFeedbackComposeViewController = nil;
|
||||
|
||||
[_lastCheck release], _lastCheck = nil;
|
||||
[_token release], _token = nil;
|
||||
[_lastMessageID release], _lastMessageID = nil;
|
||||
[_feedbackList release], _feedbackList = nil;
|
||||
|
||||
[_userID release], _userID = nil;
|
||||
[_userName release], _userName = nil;
|
||||
[_userEmail release], _userEmail = nil;
|
||||
|
||||
[_fileManager release], _fileManager = nil;
|
||||
[_feedbackDir release], _feedbackDir = nil;
|
||||
[_settingsFile release], _settingsFile = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@ -154,10 +136,10 @@
|
||||
|
||||
- (NSString *)uuidString {
|
||||
CFUUIDRef theToken = CFUUIDCreate(NULL);
|
||||
CFStringRef stringUUID = CFUUIDCreateString(NULL, theToken);
|
||||
NSString *stringUUID = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, theToken);
|
||||
CFRelease(theToken);
|
||||
|
||||
return [(NSString *)stringUUID autorelease];
|
||||
return stringUUID;
|
||||
}
|
||||
|
||||
- (NSString *)uuidAsLowerCaseAndShortened {
|
||||
@ -167,7 +149,7 @@
|
||||
#pragma mark - Feedback Modal UI
|
||||
|
||||
- (BITFeedbackListViewController *)feedbackListViewController:(BOOL)modal {
|
||||
return [[[BITFeedbackListViewController alloc] initWithModalStyle:modal] autorelease];
|
||||
return [[BITFeedbackListViewController alloc] initWithModalStyle:modal];
|
||||
}
|
||||
|
||||
- (void)showFeedbackListView {
|
||||
@ -181,7 +163,7 @@
|
||||
|
||||
|
||||
- (BITFeedbackComposeViewController *)feedbackComposeViewController {
|
||||
return [[[BITFeedbackComposeViewController alloc] init] autorelease];
|
||||
return [[BITFeedbackComposeViewController alloc] init];
|
||||
}
|
||||
|
||||
- (void)showFeedbackComposeView {
|
||||
@ -294,7 +276,7 @@
|
||||
if (![_fileManager fileExistsAtPath:_settingsFile])
|
||||
return;
|
||||
|
||||
NSData *codedData = [[[NSData alloc] initWithContentsOfFile:_settingsFile] autorelease];
|
||||
NSData *codedData = [[NSData alloc] initWithContentsOfFile:_settingsFile];
|
||||
if (codedData == nil) return;
|
||||
|
||||
NSKeyedUnarchiver *unarchiver = nil;
|
||||
@ -354,7 +336,6 @@
|
||||
}
|
||||
|
||||
[unarchiver finishDecoding];
|
||||
[unarchiver release];
|
||||
|
||||
if (!self.lastCheck) {
|
||||
self.lastCheck = [NSDate distantPast];
|
||||
@ -396,8 +377,6 @@
|
||||
|
||||
[archiver finishEncoding];
|
||||
[data writeToFile:_settingsFile atomically:YES];
|
||||
[archiver release];
|
||||
[data release];
|
||||
}
|
||||
|
||||
|
||||
@ -605,7 +584,7 @@
|
||||
NSInteger pendingMessagesCount = [messagesSendInProgress count] + [[self messagesWithStatus:BITFeedbackMessageStatusSendPending] count];
|
||||
|
||||
__block BOOL newMessage = NO;
|
||||
__block NSMutableSet *returnedMessageIDs = [[[NSMutableSet alloc] init] autorelease];
|
||||
NSMutableSet *returnedMessageIDs = [[NSMutableSet alloc] init];
|
||||
|
||||
[feedMessages enumerateObjectsUsingBlock:^(id objMessage, NSUInteger messagesIdx, BOOL *stop) {
|
||||
if ([(NSDictionary *)objMessage objectForKey:@"id"]) {
|
||||
@ -632,7 +611,7 @@
|
||||
matchingSendInProgressOrInConflictMessage.status = BITFeedbackMessageStatusRead;
|
||||
} else {
|
||||
if ([(NSDictionary *)objMessage objectForKey:@"clean_text"] || [(NSDictionary *)objMessage objectForKey:@"text"]) {
|
||||
BITFeedbackMessage *message = [[[BITFeedbackMessage alloc] init] autorelease];
|
||||
BITFeedbackMessage *message = [[BITFeedbackMessage alloc] init];
|
||||
message.text = [(NSDictionary *)objMessage objectForKey:@"clean_text"] ?: [(NSDictionary *)objMessage objectForKey:@"text"] ?: @"";
|
||||
message.name = [(NSDictionary *)objMessage objectForKey:@"name"] ?: @"";
|
||||
message.email = [(NSDictionary *)objMessage objectForKey:@"email"] ?: @"";
|
||||
@ -668,12 +647,12 @@
|
||||
latestMessageFromUser = YES;
|
||||
|
||||
if (!latestMessageFromUser && self.showAlertOnIncomingMessages && !self.currentFeedbackListViewController && !self.currentFeedbackComposeViewController) {
|
||||
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackNewMessageTitle")
|
||||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackNewMessageTitle")
|
||||
message:BITHockeyLocalizedString(@"HockeyFeedbackNewMessageText")
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackIgnore")
|
||||
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackShow"), nil
|
||||
] autorelease];
|
||||
];
|
||||
[alertView setTag:0];
|
||||
[alertView show];
|
||||
_incomingMessagesAlertShowing = YES;
|
||||
@ -802,7 +781,7 @@
|
||||
[self saveMessages];
|
||||
[self performSelector:@selector(fetchMessageUpdates) withObject:nil afterDelay:0.2];
|
||||
} else if ([responseData length]) {
|
||||
NSString *responseString = [[[NSString alloc] initWithBytes:[responseData bytes] length:[responseData length] encoding: NSUTF8StringEncoding] autorelease];
|
||||
NSString *responseString = [[NSString alloc] initWithBytes:[responseData bytes] length:[responseData length] encoding: NSUTF8StringEncoding];
|
||||
BITHockeyLog(@"INFO: Received API response: %@", responseString);
|
||||
|
||||
NSError *error = NULL;
|
||||
@ -896,7 +875,7 @@
|
||||
}
|
||||
|
||||
- (void)submitMessageWithText:(NSString *)text {
|
||||
BITFeedbackMessage *message = [[[BITFeedbackMessage alloc] init] autorelease];
|
||||
BITFeedbackMessage *message = [[BITFeedbackMessage alloc] init];
|
||||
message.text = text;
|
||||
[message setStatus:BITFeedbackMessageStatusSendPending];
|
||||
[message setToken:[self uuidAsLowerCaseAndShortened]];
|
||||
|
@ -36,20 +36,20 @@
|
||||
}
|
||||
|
||||
|
||||
@property (nonatomic, retain) NSMutableArray *feedbackList;
|
||||
@property (nonatomic, retain) NSString *token;
|
||||
@property (nonatomic, strong) NSMutableArray *feedbackList;
|
||||
@property (nonatomic, strong) NSString *token;
|
||||
|
||||
|
||||
// used by BITHockeyManager if disable status is changed
|
||||
@property (nonatomic, getter = isFeedbackManagerDisabled) BOOL disableFeedbackManager;
|
||||
|
||||
@property (nonatomic, retain) BITFeedbackListViewController *currentFeedbackListViewController;
|
||||
@property (nonatomic, retain) BITFeedbackComposeViewController *currentFeedbackComposeViewController;
|
||||
@property (nonatomic, strong) BITFeedbackListViewController *currentFeedbackListViewController;
|
||||
@property (nonatomic, strong) BITFeedbackComposeViewController *currentFeedbackComposeViewController;
|
||||
@property (nonatomic) BOOL didAskUserData;
|
||||
|
||||
@property (nonatomic, retain) NSDate *lastCheck;
|
||||
@property (nonatomic, strong) NSDate *lastCheck;
|
||||
|
||||
@property (nonatomic, retain) NSNumber *lastMessageID;
|
||||
@property (nonatomic, strong) NSNumber *lastMessageID;
|
||||
|
||||
@property (nonatomic, copy) NSString *userID;
|
||||
@property (nonatomic, copy) NSString *userName;
|
||||
|
@ -49,18 +49,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_text release], _text = nil;
|
||||
[_userID release], _userID = nil;
|
||||
[_name release], _name = nil;
|
||||
[_email release], _email = nil;
|
||||
[_date release], _date = nil;
|
||||
[_id release], _id = nil;
|
||||
[_token release], _token = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - NSCoder
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
@interface BITFeedbackUserDataViewController : UITableViewController <UITextFieldDelegate>
|
||||
|
||||
@property (nonatomic, assign) id <BITFeedbackUserDataDelegate> delegate;
|
||||
@property (nonatomic, weak) id <BITFeedbackUserDataDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
#import "BITFeedbackManagerPrivate.h"
|
||||
|
||||
@interface BITFeedbackUserDataViewController ()
|
||||
@property (nonatomic, assign) BITFeedbackManager *manager;
|
||||
@property (nonatomic, weak) BITFeedbackManager *manager;
|
||||
|
||||
@property (nonatomic, copy) NSString *name;
|
||||
@property (nonatomic, copy) NSString *email;
|
||||
@ -58,26 +58,19 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_name release], _name = nil;
|
||||
[_email release], _email = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[self.tableView setScrollEnabled:NO];
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
|
||||
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
|
||||
target:self
|
||||
action:@selector(dismissAction:)] autorelease];
|
||||
action:@selector(dismissAction:)];
|
||||
|
||||
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave
|
||||
target:self
|
||||
action:@selector(saveAction:)] autorelease];
|
||||
action:@selector(saveAction:)];
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
@ -195,13 +188,13 @@
|
||||
|
||||
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||
if (cell == nil) {
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
|
||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
|
||||
|
||||
cell.accessoryType = UITableViewCellAccessoryNone;
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
cell.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
UITextField *textField = [[[UITextField alloc] initWithFrame:CGRectMake(110, 10, 185, 30)] autorelease];
|
||||
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(110, 10, 185, 30)];
|
||||
textField.adjustsFontSizeToFitWidth = YES;
|
||||
textField.textColor = [UIColor blackColor];
|
||||
textField.backgroundColor = [UIColor lightGrayColor];
|
||||
|
@ -48,7 +48,7 @@
|
||||
Default is RGB(25, 25, 25)
|
||||
@see barStyle
|
||||
*/
|
||||
@property (nonatomic, retain) UIColor *tintColor;
|
||||
@property (nonatomic, strong) UIColor *tintColor;
|
||||
|
||||
/**
|
||||
The UIModalPresentationStyle for showing the update user interface when invoked
|
||||
|
@ -41,7 +41,7 @@
|
||||
self.tintColor = BIT_RGBCOLOR(25, 25, 25);
|
||||
_modalPresentationStyle = UIModalPresentationFormSheet;
|
||||
|
||||
NSLocale *enUSPOSIXLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease];
|
||||
NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
|
||||
_rfc3339Formatter = [[NSDateFormatter alloc] init];
|
||||
[_rfc3339Formatter setLocale:enUSPOSIXLocale];
|
||||
[_rfc3339Formatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"];
|
||||
@ -52,28 +52,13 @@
|
||||
|
||||
- (id)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironemt:(BOOL)isAppStoreEnvironment {
|
||||
if ((self = [self init])) {
|
||||
|
||||
self.appIdentifier = appIdentifier;
|
||||
_appIdentifier = appIdentifier;
|
||||
_isAppStoreEnvironment = isAppStoreEnvironment;
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[_serverURL release]; _serverURL = nil;
|
||||
|
||||
[_navController release], _navController = nil;
|
||||
|
||||
[_rfc3339Formatter release], _rfc3339Formatter = nil;
|
||||
|
||||
[_tintColor release], _tintColor = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
- (void)reportError:(NSError *)error {
|
||||
@ -165,7 +150,7 @@
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
if (_navController != nil) [_navController release], _navController = nil;
|
||||
if (_navController != nil) _navController = nil;
|
||||
|
||||
_navController = [[UINavigationController alloc] initWithRootViewController:viewController];
|
||||
_navController.navigationBar.barStyle = _barStyle;
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
@interface BITHockeyBaseManager()
|
||||
|
||||
@property (nonatomic, retain) NSString *appIdentifier;
|
||||
@property (nonatomic, strong) NSString *appIdentifier;
|
||||
|
||||
- (id)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironemt:(BOOL)isAppStoreEnvironment;
|
||||
|
||||
|
@ -32,9 +32,9 @@
|
||||
//might be better in viewDidLoad, but to workaround rdar://12214613 and as it doesn't
|
||||
//hurt, we do it here
|
||||
if (_modal) {
|
||||
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
|
||||
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
|
||||
target:self
|
||||
action:@selector(onDismissModal:)] autorelease];
|
||||
action:@selector(onDismissModal:)];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
|
@ -36,22 +36,20 @@
|
||||
#pragma mark NSString helpers
|
||||
|
||||
NSString *bit_URLEncodedString(NSString *inputString) {
|
||||
NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
|
||||
(CFStringRef)inputString,
|
||||
NULL,
|
||||
CFSTR("!*'();:@&=+$,/?%#[]"),
|
||||
kCFStringEncodingUTF8);
|
||||
[result autorelease];
|
||||
return result;
|
||||
return CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
|
||||
(__bridge CFStringRef)inputString,
|
||||
NULL,
|
||||
CFSTR("!*'();:@&=+$,/?%#[]"),
|
||||
kCFStringEncodingUTF8)
|
||||
);
|
||||
}
|
||||
|
||||
NSString *bit_URLDecodedString(NSString *inputString) {
|
||||
NSString *result = (NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,
|
||||
(CFStringRef)inputString,
|
||||
CFSTR(""),
|
||||
kCFStringEncodingUTF8);
|
||||
[result autorelease];
|
||||
return result;
|
||||
return CFBridgingRelease(CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,
|
||||
(__bridge CFStringRef)inputString,
|
||||
CFSTR(""),
|
||||
kCFStringEncodingUTF8)
|
||||
);
|
||||
}
|
||||
|
||||
NSComparisonResult bit_versionCompare(NSString *stringA, NSString *stringB) {
|
||||
@ -94,16 +92,25 @@ NSString *bit_appAnonID(void) {
|
||||
// try to new iOS6 identifierForAdvertising
|
||||
Class advertisingClass = NSClassFromString(@"ASIdentifierManager");
|
||||
if (advertisingClass) {
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
||||
id adInstance = [advertisingClass performSelector:NSSelectorFromString(@"sharedManager")];
|
||||
# pragma clang diagnostic pop
|
||||
|
||||
SEL adidSelector = NSSelectorFromString(@"advertisingIdentifier");
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
||||
return [[adInstance performSelector:adidSelector] performSelector:NSSelectorFromString(@"UUIDString")];
|
||||
# pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
// try to new iOS6 identifierForVendor, in case ASIdentifierManager is not linked
|
||||
SEL vendoridSelector = NSSelectorFromString(@"identifierForVendor");
|
||||
if ([[UIDevice currentDevice] respondsToSelector:vendoridSelector]) {
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
||||
return [[[UIDevice currentDevice] performSelector:vendoridSelector] performSelector:NSSelectorFromString(@"UUIDString")];
|
||||
# pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
// use app bundle path
|
||||
@ -360,7 +367,7 @@ UIImage *bit_newWithContentsOfResolutionIndependentFile(NSString * path) {
|
||||
UIImage *bit_imageWithContentsOfResolutionIndependentFile(NSString *path) {
|
||||
#ifndef __clang_analyzer__
|
||||
// clang alayzer in 4.2b3 thinks here's a leak, which is not the case.
|
||||
return [bit_newWithContentsOfResolutionIndependentFile(path) autorelease];
|
||||
return bit_newWithContentsOfResolutionIndependentFile(path);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@
|
||||
By default this is set to the HockeyApp servers and there rarely should be a
|
||||
need to modify that.
|
||||
*/
|
||||
@property (nonatomic, retain) NSString *serverURL;
|
||||
@property (nonatomic, strong) NSString *serverURL;
|
||||
|
||||
|
||||
/**
|
||||
@ -181,7 +181,7 @@
|
||||
@see disableCrashManager
|
||||
@return The BITCrashManager instance initialized by BITHockeyManager
|
||||
*/
|
||||
@property (nonatomic, retain, readonly) BITCrashManager *crashManager;
|
||||
@property (nonatomic, strong, readonly) BITCrashManager *crashManager;
|
||||
|
||||
|
||||
/**
|
||||
@ -207,7 +207,7 @@
|
||||
@see disableUpdateManager
|
||||
@return The BITUpdateManager instance initialized by BITHockeyManager
|
||||
*/
|
||||
@property (nonatomic, retain, readonly) BITUpdateManager *updateManager;
|
||||
@property (nonatomic, strong, readonly) BITUpdateManager *updateManager;
|
||||
|
||||
|
||||
/**
|
||||
@ -233,7 +233,7 @@
|
||||
@see disableFeedbackManager
|
||||
@return The BITFeedbackManager instance initialized by BITHockeyManager
|
||||
*/
|
||||
@property (nonatomic, retain, readonly) BITFeedbackManager *feedbackManager;
|
||||
@property (nonatomic, strong, readonly) BITFeedbackManager *feedbackManager;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -118,24 +118,11 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_appIdentifier release], _appIdentifier = nil;
|
||||
|
||||
[_crashManager release], _crashManager = nil;
|
||||
[_updateManager release], _updateManager = nil;
|
||||
[_feedbackManager release], _feedbackManager = nil;
|
||||
|
||||
_delegate = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Public Instance Methods (Configuration)
|
||||
|
||||
- (void)configureWithIdentifier:(NSString *)appIdentifier delegate:(id)delegate {
|
||||
_delegate = delegate;
|
||||
[_appIdentifier release];
|
||||
_appIdentifier = [appIdentifier copy];
|
||||
|
||||
[self initializeModules];
|
||||
@ -143,7 +130,6 @@
|
||||
|
||||
- (void)configureWithBetaIdentifier:(NSString *)betaIdentifier liveIdentifier:(NSString *)liveIdentifier delegate:(id)delegate {
|
||||
_delegate = delegate;
|
||||
[_appIdentifier release];
|
||||
|
||||
// check the live identifier now, because otherwise invalid identifier would only be logged when the app is already in the store
|
||||
if (![self checkValidityOfAppIdentifier:liveIdentifier]) {
|
||||
@ -232,7 +218,6 @@
|
||||
}
|
||||
|
||||
if (_serverURL != aServerURL) {
|
||||
[_serverURL release];
|
||||
_serverURL = [aServerURL copy];
|
||||
}
|
||||
}
|
||||
@ -345,9 +330,9 @@
|
||||
id jmcInstance = [self jmcInstance];
|
||||
SEL configureSelector = @selector(configureJiraConnect:projectKey:apiKey:);
|
||||
|
||||
NSString *url = [configuration valueForKey:@"url"];
|
||||
NSString *project = [configuration valueForKey:@"project"];
|
||||
NSString *key = [configuration valueForKey:@"key"];
|
||||
__unsafe_unretained NSString *url = [configuration valueForKey:@"url"];
|
||||
__unsafe_unretained NSString *project = [configuration valueForKey:@"project"];
|
||||
__unsafe_unretained NSString *key = [configuration valueForKey:@"key"];
|
||||
|
||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[jmcInstance methodSignatureForSelector:configureSelector]];
|
||||
invocation.target = jmcInstance;
|
||||
@ -382,12 +367,11 @@
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSMutableDictionary *trackerConfig = [[defaults valueForKey:@"BITTrackerConfigurations"] mutableCopy];
|
||||
if (!trackerConfig) {
|
||||
trackerConfig = [[NSMutableDictionary dictionaryWithCapacity:1] retain];
|
||||
trackerConfig = [NSMutableDictionary dictionaryWithCapacity:1];
|
||||
}
|
||||
|
||||
[trackerConfig setValue:[object trackerConfig] forKey:_appIdentifier];
|
||||
[defaults setValue:trackerConfig forKey:@"BITTrackerConfigurations"];
|
||||
[trackerConfig release];
|
||||
|
||||
[defaults synchronize];
|
||||
[self configureJMC];
|
||||
|
@ -32,6 +32,6 @@
|
||||
@interface BITHockeyManager () {
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) id delegate;
|
||||
@property (nonatomic, weak) id delegate;
|
||||
|
||||
@end
|
||||
|
@ -56,10 +56,10 @@
|
||||
- (id)initWithPadding:(CGPoint)padding;
|
||||
|
||||
// action delegate
|
||||
@property (nonatomic, assign) id<BITStoreButtonDelegate> buttonDelegate;
|
||||
@property (nonatomic, weak) id<BITStoreButtonDelegate> buttonDelegate;
|
||||
|
||||
// change the button layer
|
||||
@property (nonatomic, retain) BITStoreButtonData *buttonData;
|
||||
@property (nonatomic, strong) BITStoreButtonData *buttonData;
|
||||
- (void)setButtonData:(BITStoreButtonData *)aButtonData animated:(BOOL)animated;
|
||||
|
||||
// align helper
|
||||
|
@ -52,14 +52,9 @@
|
||||
}
|
||||
|
||||
+ (id)dataWithLabel:(NSString*)aLabel enabled:(BOOL)flag {
|
||||
return [[[[self class] alloc] initWithLabel:aLabel enabled:flag] autorelease];
|
||||
return [[[self class] alloc] initWithLabel:aLabel enabled:flag];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_label release], _label = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@ -184,11 +179,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_buttonData release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIView
|
||||
@ -225,8 +215,7 @@
|
||||
|
||||
- (void)setButtonData:(BITStoreButtonData *)aButtonData animated:(BOOL)animated {
|
||||
if (_buttonData != aButtonData) {
|
||||
[_buttonData release];
|
||||
_buttonData = [aButtonData retain];
|
||||
_buttonData = aButtonData;
|
||||
}
|
||||
|
||||
[self updateButtonAnimated:animated];
|
||||
|
@ -96,7 +96,7 @@ typedef enum {
|
||||
application, it is _REQUIRED_ to set this delegate and implement
|
||||
`[BITUpdateManagerDelegate customDeviceIdentifierForUpdateManager:]`!
|
||||
*/
|
||||
@property (nonatomic, assign) id delegate;
|
||||
@property (nonatomic, weak) id delegate;
|
||||
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
@ -244,7 +244,7 @@ typedef enum {
|
||||
|
||||
@see requireAuthorization
|
||||
*/
|
||||
@property (nonatomic, retain) NSString *authenticationSecret;
|
||||
@property (nonatomic, strong) NSString *authenticationSecret;
|
||||
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
@ -269,7 +269,7 @@ typedef enum {
|
||||
@see [BITUpdateManagerDelegate didDisplayExpiryAlertForUpdateManager:]
|
||||
@warning This only works when using Ad-Hoc provisioning profiles!
|
||||
*/
|
||||
@property (nonatomic, retain) NSDate *expiryDate;
|
||||
@property (nonatomic, strong) NSDate *expiryDate;
|
||||
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
|
@ -82,7 +82,6 @@
|
||||
delegate:nil
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"OK") otherButtonTitles:nil];
|
||||
[alert show];
|
||||
[alert release];
|
||||
_showFeedback = NO;
|
||||
}
|
||||
}
|
||||
@ -197,7 +196,7 @@
|
||||
}
|
||||
|
||||
- (NSString *)installationDateString {
|
||||
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
[formatter setDateFormat:@"MM/dd/yyyy"];
|
||||
double installationTimeStamp = [[NSUserDefaults standardUserDefaults] doubleForKey:kBITUpdateDateOfVersionInstallation];
|
||||
if (installationTimeStamp == 0.0f) {
|
||||
@ -370,31 +369,14 @@
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillResignActiveNotification object:nil];
|
||||
|
||||
_delegate = nil;
|
||||
|
||||
[_urlConnection cancel];
|
||||
self.urlConnection = nil;
|
||||
|
||||
[_expiryDate release];
|
||||
_expiryDate = nil;
|
||||
|
||||
[_blockingView release];
|
||||
[_currentHockeyViewController release];
|
||||
[_appVersions release];
|
||||
[_receivedData release];
|
||||
[_lastCheck release];
|
||||
[_usageStartTimestamp release];
|
||||
[_authenticationSecret release];
|
||||
[_uuid release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - BetaUpdateUI
|
||||
|
||||
- (BITUpdateViewController *)hockeyViewController:(BOOL)modal {
|
||||
return [[[BITUpdateViewController alloc] initWithModalStyle:modal] autorelease];
|
||||
return [[BITUpdateViewController alloc] initWithModalStyle:modal];
|
||||
}
|
||||
|
||||
- (void)showUpdateView {
|
||||
@ -419,22 +401,22 @@
|
||||
|
||||
if (!_updateAlertShowing) {
|
||||
if ([self hasNewerMandatoryVersion]) {
|
||||
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateAvailable")
|
||||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateAvailable")
|
||||
message:[NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateAlertMandatoryTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"UpdateInstall")
|
||||
otherButtonTitles:nil
|
||||
] autorelease];
|
||||
];
|
||||
[alertView setTag:2];
|
||||
[alertView show];
|
||||
_updateAlertShowing = YES;
|
||||
} else {
|
||||
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateAvailable")
|
||||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateAvailable")
|
||||
message:[NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateAlertTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"UpdateIgnore")
|
||||
otherButtonTitles:BITHockeyLocalizedString(@"UpdateShow"), nil
|
||||
] autorelease];
|
||||
];
|
||||
if (self.isShowingDirectInstallOption) {
|
||||
[alertView addButtonWithTitle:BITHockeyLocalizedString(@"UpdateInstall")];
|
||||
}
|
||||
@ -448,12 +430,12 @@
|
||||
|
||||
// nag the user with neverending alerts if we cannot find out the window for presenting the covering sheet
|
||||
- (void)alertFallback:(NSString *)message {
|
||||
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:nil
|
||||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil
|
||||
message:message
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyOK")
|
||||
otherButtonTitles:nil
|
||||
] autorelease];
|
||||
];
|
||||
[alertView setTag:1];
|
||||
[alertView show];
|
||||
}
|
||||
@ -471,14 +453,14 @@
|
||||
|
||||
CGRect frame = [visibleWindow frame];
|
||||
|
||||
self.blockingView = [[[UIView alloc] initWithFrame:frame] autorelease];
|
||||
UIImageView *backgroundView = [[[UIImageView alloc] initWithImage:bit_imageNamed(@"bg.png", BITHOCKEYSDK_BUNDLE)] autorelease];
|
||||
self.blockingView = [[UIView alloc] initWithFrame:frame];
|
||||
UIImageView *backgroundView = [[UIImageView alloc] initWithImage:bit_imageNamed(@"bg.png", BITHOCKEYSDK_BUNDLE)];
|
||||
backgroundView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
backgroundView.frame = frame;
|
||||
[self.blockingView addSubview:backgroundView];
|
||||
|
||||
if (image != nil) {
|
||||
UIImageView *imageView = [[[UIImageView alloc] initWithImage:bit_imageNamed(image, BITHOCKEYSDK_BUNDLE)] autorelease];
|
||||
UIImageView *imageView = [[UIImageView alloc] initWithImage:bit_imageNamed(image, BITHOCKEYSDK_BUNDLE)];
|
||||
imageView.contentMode = UIViewContentModeCenter;
|
||||
imageView.frame = frame;
|
||||
[self.blockingView addSubview:imageView];
|
||||
@ -490,7 +472,7 @@
|
||||
frame.size.width -= 40;
|
||||
frame.size.height = 50;
|
||||
|
||||
UILabel *label = [[[UILabel alloc] initWithFrame:frame] autorelease];
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:frame];
|
||||
label.text = message;
|
||||
label.textAlignment = UITextAlignmentCenter;
|
||||
label.numberOfLines = 2;
|
||||
@ -556,7 +538,7 @@
|
||||
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
|
||||
|
||||
if ([responseData length]) {
|
||||
NSString *responseString = [[[NSString alloc] initWithBytes:[responseData bytes] length:[responseData length] encoding: NSUTF8StringEncoding] autorelease];
|
||||
NSString *responseString = [[NSString alloc] initWithBytes:[responseData bytes] length:[responseData length] encoding: NSUTF8StringEncoding];
|
||||
|
||||
NSDictionary *feedDict = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:[responseString dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:&error];
|
||||
|
||||
@ -665,7 +647,7 @@
|
||||
[request setValue:@"Hockey/iOS" forHTTPHeaderField:@"User-Agent"];
|
||||
[request setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];
|
||||
|
||||
self.urlConnection = [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease];
|
||||
self.urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
|
||||
if (!_urlConnection) {
|
||||
self.checkInProgress = NO;
|
||||
[self reportError:[NSError errorWithDomain:kBITUpdateErrorDomain
|
||||
@ -683,7 +665,7 @@
|
||||
}
|
||||
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateWarning") message:BITHockeyLocalizedString(@"UpdateSimulatorMessage") delegate:nil cancelButtonTitle:BITHockeyLocalizedString(@"HockeyOK") otherButtonTitles:nil] autorelease];
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateWarning") message:BITHockeyLocalizedString(@"UpdateSimulatorMessage") delegate:nil cancelButtonTitle:BITHockeyLocalizedString(@"HockeyOK") otherButtonTitles:nil];
|
||||
[alert show];
|
||||
return NO;
|
||||
#endif
|
||||
@ -811,7 +793,7 @@
|
||||
self.checkInProgress = NO;
|
||||
|
||||
if ([self.receivedData length]) {
|
||||
NSString *responseString = [[[NSString alloc] initWithBytes:[_receivedData bytes] length:[_receivedData length] encoding: NSUTF8StringEncoding] autorelease];
|
||||
NSString *responseString = [[NSString alloc] initWithBytes:[_receivedData bytes] length:[_receivedData length] encoding: NSUTF8StringEncoding];
|
||||
BITHockeyLog(@"INFO: Received API response: %@", responseString);
|
||||
|
||||
NSError *error = nil;
|
||||
@ -837,7 +819,7 @@
|
||||
}
|
||||
|
||||
|
||||
NSString *currentAppCacheVersion = [[[self newestAppVersion].version copy] autorelease];
|
||||
NSString *currentAppCacheVersion = [[self newestAppVersion].version copy];
|
||||
|
||||
// clear cache and reload with new data
|
||||
NSMutableArray *tmpAppVersions = [NSMutableArray arrayWithCapacity:[feedArray count]];
|
||||
@ -853,7 +835,7 @@
|
||||
}
|
||||
// only set if different!
|
||||
if (![self.appVersions isEqualToArray:tmpAppVersions]) {
|
||||
self.appVersions = [[tmpAppVersions copy] autorelease];
|
||||
self.appVersions = [tmpAppVersions copy];
|
||||
}
|
||||
[self saveAppCache];
|
||||
|
||||
@ -875,7 +857,6 @@
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyOK")
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
[alert release];
|
||||
}
|
||||
|
||||
if (self.isUpdateAvailable && (self.alwaysShowUpdateReminder || newVersionDiffersFromCachedVersion || [self hasNewerMandatoryVersion])) {
|
||||
@ -913,8 +894,7 @@
|
||||
|
||||
- (void)setCurrentHockeyViewController:(BITUpdateViewController *)aCurrentHockeyViewController {
|
||||
if (_currentHockeyViewController != aCurrentHockeyViewController) {
|
||||
[_currentHockeyViewController release];
|
||||
_currentHockeyViewController = [aCurrentHockeyViewController retain];
|
||||
_currentHockeyViewController = aCurrentHockeyViewController;
|
||||
//HockeySDKLog(@"active hockey view controller: %@", aCurrentHockeyViewController);
|
||||
}
|
||||
}
|
||||
@ -925,7 +905,6 @@
|
||||
|
||||
- (void)setLastCheck:(NSDate *)aLastCheck {
|
||||
if (_lastCheck != aLastCheck) {
|
||||
[_lastCheck release];
|
||||
_lastCheck = [aLastCheck copy];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setObject:_lastCheck forKey:kBITUpdateDateOfLastCheck];
|
||||
@ -935,16 +914,15 @@
|
||||
|
||||
- (void)setAppVersions:(NSArray *)anAppVersions {
|
||||
if (_appVersions != anAppVersions || !_appVersions) {
|
||||
[_appVersions release];
|
||||
[self willChangeValueForKey:@"appVersions"];
|
||||
|
||||
// populate with default values (if empty)
|
||||
if (![anAppVersions count]) {
|
||||
BITAppVersionMetaInfo *defaultApp = [[[BITAppVersionMetaInfo alloc] init] autorelease];
|
||||
BITAppVersionMetaInfo *defaultApp = [[BITAppVersionMetaInfo alloc] init];
|
||||
defaultApp.name = bit_appName(BITHockeyLocalizedString(@"HockeyAppNamePlaceholder"));
|
||||
defaultApp.version = _currentAppVersion;
|
||||
defaultApp.shortVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
|
||||
_appVersions = [[NSArray arrayWithObject:defaultApp] retain];
|
||||
_appVersions = [NSArray arrayWithObject:defaultApp];
|
||||
} else {
|
||||
_appVersions = [anAppVersions copy];
|
||||
}
|
||||
@ -960,8 +938,7 @@
|
||||
- (void)setBlockingView:(UIView *)anBlockingView {
|
||||
if (_blockingView != anBlockingView) {
|
||||
[_blockingView removeFromSuperview];
|
||||
[_blockingView release];
|
||||
_blockingView = [anBlockingView retain];
|
||||
_blockingView = anBlockingView;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,25 +41,25 @@
|
||||
// are we currently checking for updates?
|
||||
@property (nonatomic, assign, getter=isCheckInProgress) BOOL checkInProgress;
|
||||
|
||||
@property (nonatomic, retain) NSMutableData *receivedData;
|
||||
@property (nonatomic, strong) NSMutableData *receivedData;
|
||||
|
||||
@property (nonatomic, copy) NSDate *lastCheck;
|
||||
|
||||
// get array of all available versions
|
||||
@property (nonatomic, copy) NSArray *appVersions;
|
||||
|
||||
@property (nonatomic, retain) NSURLConnection *urlConnection;
|
||||
@property (nonatomic, strong) NSURLConnection *urlConnection;
|
||||
|
||||
@property (nonatomic, copy) NSDate *usageStartTimestamp;
|
||||
|
||||
@property (nonatomic, retain) UIView *blockingView;
|
||||
@property (nonatomic, strong) UIView *blockingView;
|
||||
|
||||
// if YES, the API will return an existing JMC config
|
||||
// if NO, the API will return only version information
|
||||
@property (nonatomic, assign) BOOL checkForTracker;
|
||||
|
||||
// Contains the tracker config if received from server
|
||||
@property (nonatomic, retain) NSDictionary *trackerConfig;
|
||||
@property (nonatomic, strong) NSDictionary *trackerConfig;
|
||||
|
||||
// used by BITHockeyManager if disable status is changed
|
||||
@property (nonatomic, getter = isUpdateManagerDisabled) BOOL disableUpdateManager;
|
||||
@ -77,7 +77,7 @@
|
||||
- (void)checkForAuthorization;
|
||||
|
||||
// get/set current active hockey view controller
|
||||
@property (nonatomic, retain) BITUpdateViewController *currentHockeyViewController;
|
||||
@property (nonatomic, strong) BITUpdateViewController *currentHockeyViewController;
|
||||
|
||||
// convenience method to get current running version string
|
||||
- (NSString *)currentAppVersion;
|
||||
|
@ -153,15 +153,15 @@
|
||||
UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, kMinPreviousVersionButtonHeight)];
|
||||
footerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
footerView.backgroundColor = BIT_RGBCOLOR(245, 245, 245);
|
||||
UIView *lineView1 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 1)] autorelease];
|
||||
UIView *lineView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 1)];
|
||||
lineView1.backgroundColor = BIT_RGBCOLOR(214, 214, 214);
|
||||
lineView1.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
[footerView addSubview:lineView1];
|
||||
UIView *lineView2 = [[[UIView alloc] initWithFrame:CGRectMake(0, 1, self.view.frame.size.width, 1)] autorelease];
|
||||
UIView *lineView2 = [[UIView alloc] initWithFrame:CGRectMake(0, 1, self.view.frame.size.width, 1)];
|
||||
lineView2.backgroundColor = BIT_RGBCOLOR(221, 221, 221);
|
||||
lineView2.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
[footerView addSubview:lineView2];
|
||||
UIView *lineView3 = [[[UIView alloc] initWithFrame:CGRectMake(0, 1, self.view.frame.size.width, 1)] autorelease];
|
||||
UIView *lineView3 = [[UIView alloc] initWithFrame:CGRectMake(0, 1, self.view.frame.size.width, 1)];
|
||||
lineView3.backgroundColor = BIT_RGBCOLOR(255, 255, 255);
|
||||
lineView3.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
[footerView addSubview:lineView3];
|
||||
@ -181,7 +181,6 @@
|
||||
[footerView addSubview:footerButton];
|
||||
self.tableView.tableFooterView = footerView;
|
||||
[self realignPreviousVersionButton];
|
||||
[footerView release];
|
||||
} else {
|
||||
self.tableView.tableFooterView = nil;
|
||||
self.tableView.backgroundColor = BIT_RGBCOLOR(235, 235, 235);
|
||||
@ -241,8 +240,6 @@
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_appStoreHeader release]; _appStoreHeader = nil;
|
||||
[_popOverController release], _popOverController = nil;
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
// test if KVO's are registered. if class is destroyed before it was shown(viewDidLoad) no KVOs are registered.
|
||||
@ -257,9 +254,7 @@
|
||||
for (UITableViewCell *cell in _cells) {
|
||||
[cell removeObserver:self forKeyPath:@"webViewSize"];
|
||||
}
|
||||
[_cells release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@ -282,7 +277,7 @@
|
||||
self.tableView.backgroundColor = BIT_RGBCOLOR(245, 245, 245);
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
|
||||
UIView *topView = [[[UIView alloc] initWithFrame:CGRectMake(0, -(600-kAppStoreViewHeight), self.view.frame.size.width, 600)] autorelease];
|
||||
UIView *topView = [[UIView alloc] initWithFrame:CGRectMake(0, -(600-kAppStoreViewHeight), self.view.frame.size.width, 600)];
|
||||
topView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
topView.backgroundColor = BIT_RGBCOLOR(245, 245, 245);
|
||||
[self.tableView addSubview:topView];
|
||||
@ -342,13 +337,13 @@
|
||||
|
||||
self.tableView.tableHeaderView = _appStoreHeader;
|
||||
|
||||
BITStoreButton *storeButton = [[[BITStoreButton alloc] initWithPadding:CGPointMake(5, 58)] autorelease];
|
||||
BITStoreButton *storeButton = [[BITStoreButton alloc] initWithPadding:CGPointMake(5, 58)];
|
||||
storeButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
|
||||
storeButton.buttonDelegate = self;
|
||||
[self.tableView.tableHeaderView addSubview:storeButton];
|
||||
storeButton.buttonData = [BITStoreButtonData dataWithLabel:@"" enabled:NO];
|
||||
[storeButton alignToSuperview];
|
||||
_appStoreButton = [storeButton retain];
|
||||
_appStoreButton = storeButton;
|
||||
self.appStoreButtonState = AppStoreButtonStateCheck;
|
||||
}
|
||||
|
||||
@ -396,7 +391,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
BITWebTableViewCell *cell = [[[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier] autorelease];
|
||||
BITWebTableViewCell *cell = [[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier];
|
||||
[self configureWebCell:cell forAppVersion:appVersion];
|
||||
[_cells addObject:cell];
|
||||
|
||||
@ -423,7 +418,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
BITWebTableViewCell *cell = [[[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier] autorelease];
|
||||
BITWebTableViewCell *cell = [[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier];
|
||||
[self configureWebCell:cell forAppVersion:appVersion];
|
||||
[_cells addObject:cell];
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ typedef enum {
|
||||
@interface BITUpdateViewController() <BITStoreButtonDelegate> {
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) BITUpdateManager *updateManager;
|
||||
@property (nonatomic, weak) BITUpdateManager *updateManager;
|
||||
@property (nonatomic, readwrite) BOOL modal;
|
||||
|
||||
@property (nonatomic, assign) AppStoreButtonState appStoreButtonState;
|
||||
|
@ -34,10 +34,10 @@
|
||||
|
||||
@interface BITWebTableViewCell : UITableViewCell <UIWebViewDelegate>
|
||||
|
||||
@property (nonatomic, retain) UIWebView *webView;
|
||||
@property (nonatomic, strong) UIWebView *webView;
|
||||
@property (nonatomic, copy) NSString *webViewContent;
|
||||
@property (nonatomic, assign) CGSize webViewSize;
|
||||
@property (nonatomic, retain) UIColor *cellBackgroundColor;
|
||||
@property (nonatomic, strong) UIColor *cellBackgroundColor;
|
||||
|
||||
- (void)addWebView;
|
||||
|
||||
|
@ -54,7 +54,7 @@ body { font: 13px 'Helvetica Neue', Helvetica; color:#626262; word-wrap:break-wo
|
||||
if(_webViewContent) {
|
||||
CGRect webViewRect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
|
||||
if(!_webView) {
|
||||
_webView = [[[UIWebView alloc] initWithFrame:webViewRect] retain];
|
||||
_webView = [[UIWebView alloc] initWithFrame:webViewRect];
|
||||
[self addSubview:_webView];
|
||||
_webView.hidden = YES;
|
||||
_webView.backgroundColor = self.cellBackgroundColor;
|
||||
@ -100,7 +100,6 @@ body { font: 13px 'Helvetica Neue', Helvetica; color:#626262; word-wrap:break-wo
|
||||
_webView.delegate = nil;
|
||||
[_webView resignFirstResponder];
|
||||
[_webView removeFromSuperview];
|
||||
[_webView release];
|
||||
}
|
||||
_webView = nil;
|
||||
[self setNeedsDisplay];
|
||||
@ -109,8 +108,7 @@ body { font: 13px 'Helvetica Neue', Helvetica; color:#626262; word-wrap:break-wo
|
||||
|
||||
- (void)setWebViewContent:(NSString *)aWebViewContent {
|
||||
if (_webViewContent != aWebViewContent) {
|
||||
[_webViewContent release];
|
||||
_webViewContent = [aWebViewContent retain];
|
||||
_webViewContent = aWebViewContent;
|
||||
|
||||
// add basic accessiblity (prevents "snarfed from ivar layout") logs
|
||||
self.accessibilityLabel = aWebViewContent;
|
||||
@ -129,8 +127,6 @@ body { font: 13px 'Helvetica Neue', Helvetica; color:#626262; word-wrap:break-wo
|
||||
|
||||
- (void)dealloc {
|
||||
[self removeWebView];
|
||||
[_webViewContent release], _webViewContent = nil;;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ NSBundle *BITHockeyBundle(void) {
|
||||
dispatch_once(&predicate, ^{
|
||||
NSString* mainBundlePath = [[NSBundle mainBundle] resourcePath];
|
||||
NSString* frameworkBundlePath = [mainBundlePath stringByAppendingPathComponent:BITHOCKEYSDK_BUNDLE];
|
||||
bundle = [[NSBundle bundleWithPath:frameworkBundlePath] retain];
|
||||
bundle = [NSBundle bundleWithPath:frameworkBundlePath];
|
||||
});
|
||||
return bundle;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@
|
||||
1E754E601621FBB70070AB92 /* BITCrashReportTextFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E754E5A1621FBB70070AB92 /* BITCrashReportTextFormatter.h */; };
|
||||
1E754E611621FBB70070AB92 /* BITCrashReportTextFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E754E5B1621FBB70070AB92 /* BITCrashReportTextFormatter.m */; };
|
||||
1EACC97B162F041E007578C5 /* BITAttributedLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EACC979162F041E007578C5 /* BITAttributedLabel.h */; };
|
||||
1EACC97C162F041E007578C5 /* BITAttributedLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EACC97A162F041E007578C5 /* BITAttributedLabel.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
|
||||
1EACC97C162F041E007578C5 /* BITAttributedLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EACC97A162F041E007578C5 /* BITAttributedLabel.m */; };
|
||||
1EAF20A8162DC0F600957B1D /* feedbackActivity@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 1EAF20A4162DC0F600957B1D /* feedbackActivity@2x~ipad.png */; };
|
||||
1EAF20A9162DC0F600957B1D /* feedbackActivity~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 1EAF20A5162DC0F600957B1D /* feedbackActivity~ipad.png */; };
|
||||
1EAF20AA162DC0F600957B1D /* feedbackActiviy.png in Resources */ = {isa = PBXBuildFile; fileRef = 1EAF20A6162DC0F600957B1D /* feedbackActiviy.png */; };
|
||||
@ -749,6 +749,7 @@
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
@ -768,7 +769,7 @@
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||
RUN_CLANG_STATIC_ANALYZER = YES;
|
||||
SDKROOT = iphoneos;
|
||||
@ -782,6 +783,7 @@
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
@ -797,7 +799,7 @@
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||
RUN_CLANG_STATIC_ANALYZER = YES;
|
||||
SDKROOT = iphoneos;
|
||||
|
Loading…
x
Reference in New Issue
Block a user