debug log has print:
-[GMSIndoorState didReceiveMemoryWarning:]: message sent to deallocated instance 0x210b2010
but I cannot figure out where's wrong
It seems related about take photo process,
it just crash between present actionsheet to take photo and dismiss imagePicker
so I cannot use NSZombie to debug
it happened sometimes, sometimes not. please help.
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if ([actionSheet.title isEqualToString:NSLocalizedString(@"Delete the photo has picked?", nil)]) {
if (buttonIndex != [actionSheet cancelButtonIndex]) {
NSLog(@"photo deleted");
self.selectedPhoto = nil;
self.photoLabel.text = NSLocalizedString(@"Take One", nil);
self.photoIsOn = NO;
self.photoIcon.image = [UIImage imageNamed:@"camera_icon_off_60.png"];
}
} else {
NSLog(@"Source button tapped index: %d", buttonIndex);
if (buttonIndex != [actionSheet cancelButtonIndex]) {
self.imagePicker = [[UIImagePickerController alloc] init];
self.imagePicker.delegate = self;
switch (buttonIndex) {
case 0: //Camera
self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
break;
case 1: //Library
self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
default:
break;
}
[self presentViewController:self.imagePicker
animated:YES
completion:nil];
}
}
}
- (void)friendPickerViewControllerSelectionDidChange:(FBFriendPickerViewController *)friendPicker
{
self.selectedFriedns = friendPicker.selection;
[self updateSelections];
}
- (void)updateSelections
{
//update picked photo
self.photoLabel.text = (self.selectedPhoto ? NSLocalizedString(@"Taken", nil) : NSLocalizedString(@"Take one", nil));
self.photoIsOn = (self.selectedPhoto != nil ? YES : NO);
self.photoIcon.image = (self.selectedPhoto != nil ?
[UIImage imageNamed:@"camera_icon_60.png"] :
[UIImage imageNamed:@"camera_icon_off_60.png"]);
self.sendButton.enabled = (self.textView.text != nil);
}