Small optimizations

This commit is contained in:
Lukas Spieß 2014-04-24 15:38:31 +02:00
parent 27cc84a84c
commit 4aee9f81b5
2 changed files with 10 additions and 5 deletions

View File

@ -265,7 +265,7 @@ typedef NS_ENUM(NSUInteger, BITCrashManagerUserInput) {
@return BOOl if the input is a valid option
@see BITCrashManagerUserInput
*/
- (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput withCrashMetaDescription:metaDescription;
- (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput crashMetaDescription:metaDescription;
/**
Property that lets you set a custom block which handles showing a custom UI and asking the user

View File

@ -496,7 +496,7 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
}
- (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput withCrashMetaDescription:(NSString *)metaDescription{
- (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput crashMetaDescription:(NSString *)metaDescription{
switch (userInput) {
case BITCrashManagerUserInputDontSend:
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashManagerWillCancelSendingCrashReport:)]) {
@ -522,6 +522,11 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
[self.delegate crashManagerWillSendCrashReportsAlways:self];
}
if (metaDescription && [metaDescription length] > 0) {
NSError *error;
[metaDescription writeToFile:[NSString stringWithFormat:@"%@_description.meta", [_crashesDir stringByAppendingPathComponent: _lastCrashFilename]] atomically:YES encoding:NSUTF8StringEncoding error:&error];
}
[self sendCrashReports];
return YES;
@ -985,13 +990,13 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0:
[self handleUserInput:BITCrashManagerUserInputDontSend withCrashMetaDescription:nil];
[self handleUserInput:BITCrashManagerUserInputDontSend crashMetaDescription:nil];
break;
case 1:
[self handleUserInput:BITCrashManagerUserInputSend withCrashMetaDescription:nil];
[self handleUserInput:BITCrashManagerUserInputSend crashMetaDescription:nil];
break;
case 2:
[self handleUserInput:BITCrashManagerUserInputAlwaysSend withCrashMetaDescription:nil];
[self handleUserInput:BITCrashManagerUserInputAlwaysSend crashMetaDescription:nil];
break;
}
}