Skip to content

Commit aff1346

Browse files
committed
Fix crash when attaching audio recording
1 parent 329b172 commit aff1346

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ Adheres to [Semantic Versioning](http://semver.org/).
2121
* Allow cancelling a GeoPackage download
2222

2323
##### Bug Fixes
24-
24+
25+
* Fix crash when attaching audio recording
2526
## 2.0.14 (https://github.com/ngageoint/mage-ios/releases/tag/2.0.14)
2627

2728
##### Release Notes

MAGE.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@
18491849
ORGANIZATIONNAME = "National Geospatial Intelligence Agency";
18501850
TargetAttributes = {
18511851
F7A94D6518AD9CB000CB9EE0 = {
1852-
DevelopmentTeam = XMTP7J7Y9Q;
1852+
DevelopmentTeam = ZL8G5D9G2H;
18531853
ProvisioningStyle = Automatic;
18541854
SystemCapabilities = {
18551855
com.apple.DataProtection = {
@@ -2602,7 +2602,7 @@
26022602
CODE_SIGN_IDENTITY = "iPhone Developer";
26032603
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
26042604
CODE_SIGN_STYLE = Automatic;
2605-
DEVELOPMENT_TEAM = XMTP7J7Y9Q;
2605+
DEVELOPMENT_TEAM = ZL8G5D9G2H;
26062606
ENABLE_BITCODE = YES;
26072607
GCC_PRECOMPILE_PREFIX_HEADER = YES;
26082608
GCC_PREFIX_HEADER = "Mage/MAGE-Prefix.pch";
@@ -2632,7 +2632,7 @@
26322632
CODE_SIGN_IDENTITY = "iPhone Developer";
26332633
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
26342634
CODE_SIGN_STYLE = Automatic;
2635-
DEVELOPMENT_TEAM = XMTP7J7Y9Q;
2635+
DEVELOPMENT_TEAM = ZL8G5D9G2H;
26362636
ENABLE_BITCODE = YES;
26372637
GCC_PRECOMPILE_PREFIX_HEADER = YES;
26382638
GCC_PREFIX_HEADER = "Mage/MAGE-Prefix.pch";

Mage/AudioRecorderViewController.m

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ - (IBAction)deleteRecording:(id)sender {
8686
#pragma
8787
#pragma mark - Voice Recording
8888

89-
- (IBAction) startRecording{
89+
- (IBAction) startRecording {
9090
[self performSelectorInBackground:@selector(performRecording) withObject:nil];
9191
}
9292

93-
-(void) performRecording{
93+
-(void) performRecording {
9494

95-
if(!isRecording){
95+
if (!isRecording) {
9696
[[NSOperationQueue mainQueue] addOperationWithBlock:^ {
9797
[self.recordBarButton setImage: [UIImage imageNamed:@"stop"] forState:UIControlStateNormal];
9898
}];
@@ -111,12 +111,12 @@ -(void) performRecording{
111111
}
112112
[audioSession setActive:YES error:&err];
113113
err = nil;
114-
if(err){
114+
if(err) {
115115
NSLog(@"audioSession: %@ %ld %@", [err domain], (long)[err code], [[err userInfo] description]);
116116
return;
117117
}
118-
NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithCapacity:0];
119118

119+
NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithCapacity:0];
120120
[settings setValue :[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];
121121
[settings setValue:[NSNumber numberWithFloat:8000.0] forKey:AVSampleRateKey];
122122
[settings setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey];
@@ -177,9 +177,13 @@ -(void) performRecording{
177177
// start recording
178178
[self.recorder record];
179179

180-
}else{
180+
} else {
181181
isRecording = NO;
182-
[self.recordBarButton setImage:[UIImage imageNamed:@"record"] forState:UIControlStateNormal];
182+
183+
[[NSOperationQueue mainQueue] addOperationWithBlock:^ {
184+
[self.recordBarButton setImage:[UIImage imageNamed:@"record"] forState:UIControlStateNormal];
185+
}];
186+
183187
[self.recorder stop];
184188
if (_sliderTimer != nil && _sliderTimer.isValid) {
185189
[_sliderTimer invalidate];

0 commit comments

Comments
 (0)