Ios 升级后,XCode在断点或日志记录时未中断(4.2->;4.3)
注意:此问题与XCode有关。原始问题已就位,但标题已更新以反映实际问题。 我使用表视图进行表单输入,并创建了一种库,用于向表中添加输入字段。在输入字段上,我需要一个图像捕获字段来启动设备摄像头 我已经声明了如下接口Ios 升级后,XCode在断点或日志记录时未中断(4.2->;4.3),ios,ios5,uitableview,uiimagepickercontroller,Ios,Ios5,Uitableview,Uiimagepickercontroller,注意:此问题与XCode有关。原始问题已就位,但标题已更新以反映实际问题。 我使用表视图进行表单输入,并创建了一种库,用于向表中添加输入字段。在输入字段上,我需要一个图像捕获字段来启动设备摄像头 我已经声明了如下接口 @interface PhotoBlockCell : UITableViewCell < UINavigationControllerDelegate, UIImagePickerControllerDelegate > - (IBAction)addPhoto:(id)s
@interface PhotoBlockCell : UITableViewCell < UINavigationControllerDelegate, UIImagePickerControllerDelegate >
- (IBAction)addPhoto:(id)sender{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == YES){
if ([sender isKindOfClass:[UIButton class]])
activeButton = (UIButton*)sender;
UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
[self.delegate presentModalViewController:imagePicker animated:YES];
}
}
为了启动图像捕获,我让一个委托指向容纳我的表视图的父视图控制器。我使用UIImagePickerController启动设备摄像头,如下所示
@interface PhotoBlockCell : UITableViewCell < UINavigationControllerDelegate, UIImagePickerControllerDelegate >
- (IBAction)addPhoto:(id)sender{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == YES){
if ([sender isKindOfClass:[UIButton class]])
activeButton = (UIButton*)sender;
UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
[self.delegate presentModalViewController:imagePicker animated:YES];
}
}
这样启动设备摄像头时不会出现问题,但我似乎无法捕获结果照片。添加断点似乎表明didFinishPickingMediaWithInfo从未触发
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
// button 1
if (activeButton == button1) {
photo1 = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
}
// dismiss the picker
[picker dismissModalViewControllerAnimated:YES];
}
但是,视图控制器将被解除。你知道问题出在哪里吗?显然,这一直都在起作用,问题与最近从XCode 4.2升级到4.3有关(我今天被迫在将手机升级到5.1后升级)。似乎我的设备内部的某个标志在调试时阻止了中断/记录。一次手动暂停就把事情弄清楚了 我按照指示解决了这个问题