- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当您滚动 UIImagePickerController 弹出框(PhotoLibrary 或 PhotosAlbum 变种)时,我的 iPad 应用程序崩溃了。我的相册中有大约 130 张图像,当您滚动列表以显示更多缩略图时发生崩溃。我在 iOS 2.x 的模拟器中发现了其他一些关于 UIImagePicker 问题的提及 here ,但这似乎并不相关。这是崩溃报告:
2011-10-07 11:18:17.309 Experiences[1419:707] *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0x343fe0> was mutated while being enumerated.(
"<PLImageTableSegment: 0x343fc0>",
"<null>",
"<null>",
"<PLImageTableSegment: 0x343fc0>",
"<PLImageTableSegment: 0x343fc0>",
"<PLImageTableSegment: 0x343fc0>",
"<PLImageTableSegment: 0x343fc0>",
"<PLImageTableSegment: 0x343fc0>",
"<PLImageTableSegment: 0x343fc0>",
"<PLImageTableSegment: 0x343fc0>",
"<PLImageTableSegment: 0x343fc0>",
"<PLImageTableSegment: 0x343fc0>"
)'
*** Call stack at first throw:
(
0 CoreFoundation 0x319b864f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x34af4c5d objc_exception_throw + 24
2 CoreFoundation 0x319b7edf __NSFastEnumerationMutationHandler + 214
3 libobjc.A.dylib 0x34afb36d objc_enumerationMutation + 24
4 CoreFoundation 0x31922b9d -[__NSArrayM dealloc] + 80
5 CoreFoundation 0x3191cc43 -[NSObject(NSObject) release] + 30
6 PhotoLibrary 0x3733ba81 +[PLImageTable releaseSegmentCache] + 20
7 PhotoLibrary 0x3732a4ed -[PLPhotoLibrary dealloc] + 116
8 CoreFoundation 0x3191cc43 -[NSObject(NSObject) release] + 30
9 CoreFoundation 0x3191d1a1 CFRelease + 68
10 CoreFoundation 0x3191febb _CFAutoreleasePoolPop + 146
11 Foundation 0x30efe1cb -[NSAutoreleasePool release] + 98
12 UIKit 0x36f0ff0f _UIApplicationHandleEvent + 5790
13 GraphicsServices 0x35a10e77 PurpleEventCallback + 666
14 CoreFoundation 0x3198fa97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
15 CoreFoundation 0x3199183f __CFRunLoopDoSource1 + 166
16 CoreFoundation 0x3199260d __CFRunLoopRun + 520
17 CoreFoundation 0x31922ec3 CFRunLoopRunSpecific + 230
18 CoreFoundation 0x31922dcb CFRunLoopRunInMode + 58
19 GraphicsServices 0x35a1041f GSEventRunModal + 114
20 GraphicsServices 0x35a104cb GSEventRun + 62
21 UIKit 0x36f3ad69 -[UIApplication _run] + 404
22 UIKit 0x36f38807 UIApplicationMain + 670
23 Experiences 0x00002e77 main + 82
24 Experiences 0x00002e20 start + 40
)
terminate called after throwing an instance of 'NSException'
下面是调用 UIImagePickerController 弹出框的代码:
- (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType
{
if ([self.cameraPopoverViewController isPopoverVisible]) {
DLog(@"requesting cameraPopover dismissal");
[self.cameraPopoverViewController dismissPopoverAnimated:YES];
}
// Set up the imagePicker common parameters
UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage, nil];
imagePicker.allowsEditing = YES;
imagePicker.sourceType = sourceType;
DLog(@"imagePicker %@", imagePicker);
self.newMedia = NO;
switch (imagePicker.sourceType) {
case UIImagePickerControllerSourceTypeCamera: {
[self presentModalViewController:imagePicker
animated:YES];
self.newMedia = YES;
break;
}
case UIImagePickerControllerSourceTypePhotoLibrary:
// These two cases are identical, just fall through into PhotosAlbum case...
case UIImagePickerControllerSourceTypeSavedPhotosAlbum: {
if (self.pickerPopoverViewController) {
// Should never occur if pickers are getting dismissed properly...
ALog(@"had a stranded pickerPopover!");
self.pickerPopoverViewController = nil;
}
pickerPopoverViewController = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
// Set up the rect from which the popover should hang
CGRect popoverRect = [cameraBtn convertRect:cameraBtn.bounds
toView:self.view];
// ...and display the popover "hanging" from the cameraBtn
[self.pickerPopoverViewController presentPopoverFromRect:popoverRect
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionUp
animated:YES];
break;
}
default:
break;
}
[imagePicker release];
}
在我看来,一些 image/imageThumbnails 正在被释放(因此改变了集合)。但是我不知道该怎么办...
最佳答案
我刚遇到类似的问题。通过反复试验,我发现如果您使用 UIImagePickerControllerSourceTypePhotoLibrary 作为图像选择器的源类型,它将正常工作。但是使用 UIImagePickerControllerSourceTypeSavedPhotosAlbum 会使应用程序崩溃。
关于ios - UIImagePickerController - 集合在枚举时发生变异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7690790/
我有一个包含配对数据的数据集(同一家庭的成员)。 身份证 是个人标识符和 户号是合作伙伴的标识符(反之亦然)。 我需要的是为每个 添加一个额外的列(职业)。 id 他\她的伴侣。 我的数据看起来像这样
mutate 能否根据跨变量应用的逻辑条件创建新变量? 更具体地说,请考虑以下数据。 set.seed(1234) val = 1) head(dat) a b c d anyABCD 1 0 0
我的 df 看起来像这样: df % mutate_at(vars(starts_with("paid")), list(prc = ~. / expenses)) # expenses mon
我的 df 看起来像这样: df % mutate_at(vars(starts_with("paid")), list(prc = ~. / expenses)) # expenses mon
我在这里为项目 Euler 问题 31 运行了这个简单的代码。 不需要 Euler Q;我只想知道,为什么我的列表值会发生变化,即这是打印 [2.0,2.0,2.0,2.0,2.0] 的许多列表的列表
我使用了排列和变异组合来根据分组进行添加。例如,我使用了以下内容: master_df % group_by(asof_dt) %>% mutate(tot_flag = sum(ls_fla
我在让 mutate、cross 和 case_when 正常运行时遇到了一些麻烦,我在这里重新创建了一个简单版本的问题: a 1 1 2 3 2 2
我有代表用户某种交易类型的不规则时间序列数据。每行数据都带有时间戳,表示当时的事务。由于数据的不规则性质,某些用户一天可能有100行,而其他用户一天可能有0或1个事务。 数据可能看起来像这样: dat
您如何恰本地解释为什么这两个示例不同? // Reassignment let a = 1; let b = a; a = 2; console.log(b); // → 1 // Mutation
基本上我想做的是发送一个字符串列表 ex: ["aa","bb","vv"] 到 graphql Mutation 字段中,目前这是我的 Mutation Schema "listTest": &gr
使用 dplyr 进行组均值居中的有效/首选方法是什么,即获取组中的每个元素(mutate)并对其执行操作和汇总统计信息(该组的总结)。以下是使用基本 R 以 mtcars 为中心的组均值: do.c
pcd % arrange(tripNo, procDate, delay) %>% group_by(tripNo) %>% mutate(delayErr = (row_number(
我想知道查询类型后面的字符串有什么意义,在这种情况下是“ProvisionQueues”,似乎从字符串中删除它不会影响任何东西——它只是用于日志记录还是什么。元数据? mutation Provisi
所以,我正在尝试设计我的 Apollo 服务器。我想用一个对象作为参数来创建一个突变。 这是我的架构的一个片段,它以某种方式导致了问题: 我认为它在语法上是正确的,但我遇到了这个错误: {"error
CREATE OR REPLACE TRIGGER UPDATE_TEST_280510 AFTER insert on TEST_TRNCOMPVISIT declare V_TRNCOMPNO N
我有以下带有查询和突变的组件,但我的组件没有收到数据和突变 prop。 我的代码是不是做错了什么或遗漏了什么?虽然查询确实得到执行,但它没有传递下去。 this.props.mutate 和 this
我用 Go 编写了一个客户端应用程序,它需要与服务器端的 C 程序进行交互。客户端执行 AES CFB 加密,服务器解密。不幸的是,服务器端存在重用初始化向量的错误。它尝试根据以下条件进行 3 次解密
我的前端是 localhost:3000 ,我的 GraphQL 服务器是 localhost:3333 . 我已经使用 react-apollo 在 JSX 领域中查询/变异,但还没有从 Expre
我试图改变通常情况下来自 kube-scheduler 的资源“绑定(bind)”。 以下是我的“ValidatingWebhookConfiguration”yaml: apiVersion: ad
如所述here , 这是一个 reference implementation用于 kubernetes e2e 测试的 webhook 服务器。在 main 函数中,定义了一些端点来处理不同的突变请
我是一名优秀的程序员,十分优秀!