- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我们的用户在使用以下方法时经常遇到崩溃。崩溃总是发生在以下行之一:[lbl sizeToFit]
(lbl
变量被重新初始化和重用。据我所知,这不会导致任何问题).
这些崩溃只发生在 iOS8 上(相同的方法在 ios7 上使用了很长时间,没有任何问题)。我自己无法重现这次崩溃。目前,我唯一的线索来自“sizeToFit”苹果文档:
..In some cases, if a view does not have a superview, it may size itself to the screen bounds. Thus, if you want a given view to size itself to its parent view, you should add it to the parent view before calling this method.
但是,我不明白这会如何产生错误的内存引用。
-(void)setUpHeaders:(NSInteger)fortype{
headers = [NSMutableArray array];
if(fortype == GROUP_BY_TIME){
for(int i=0;i<4;i++){
UIView* header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 68)];
header.backgroundColor = [UIColor whiteColor];
[headers addObject:header];
}
int today = (int)[NSDate dayOfTheWeekOfDate:[NSDate date]];
int firstDayOfTheWeek = (int)[defaults integerForKey:FIRST_DAY_IF_THE_WEEK_KEY];
NSString* restOfTheWeek = nil;
if(today == ((firstDayOfTheWeek + 4) % 7) + 1) restOfTheWeek = MyLocalizedString(@"THE COMING WEEK", @"THE COMING WEEK") ;
else if(today == ((firstDayOfTheWeek + 5) % 7) + 1) restOfTheWeek = MyLocalizedString(@"REST OF NEXT WEEK", @"REST OF NEXT WEEK") ;
else restOfTheWeek = MyLocalizedString(@"REST OF THE WEEK", @"REST OF THE WEEK") ;
UILabel* lbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 38, 300, 30)];
lbl.tag = 22;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:MyLocalizedString(@"TODAY", @"TODAY") ];
[lbl sizeToFit];
[[headers objectAtIndex:0] addSubview:lbl];
lbl = [[UILabel alloc] initWithFrame:CGRectMake([MyLocalizedString(@"TODAY", @"TODAY") sizeWithFont:[UIFont fontWithName:@"Volkswagen-Serial-Medium-Regular" size:21]].width + 15, 41, 300, 30)];
lbl.tag = 2;
lbl.font = [UIFont fontWithName:@"Volkswagen-Regular" size:19];
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
NSDateComponents *components = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate date]];
[lbl setText:[NSString stringWithFormat:@" %@, %@ %d ",[[[NSLocale currentLocale] localeIdentifier] containSubString:@"he"] ? [[[NSDate date] dayOfTheWeekString] uppercaseString] : [[[NSDate date] threeLetterDayOfTheWeekString] uppercaseString],[NSDate abbriviatedMonthForDate:[NSDate date]],(int)[components day]]];
lbl.textAlignment = NSTextAlignmentCenter;
[lbl sizeToFit];
[[headers objectAtIndex:0] addSubview:lbl];
UIImageView *img;
img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 67, 320, 1)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[[headers objectAtIndex:0] addSubview:img];
img = [[UIImageView alloc] initWithFrame:CGRectMake(lbl.frame.origin.x+2, 40, 1, 19)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 33;
[[headers objectAtIndex:0] addSubview:img];
lbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 38, 300, 30)];
lbl.tag = 22;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:MyLocalizedString(@"TOMORROW", @"TOMORROW")];
[lbl sizeToFit];
[[headers objectAtIndex:1] addSubview:lbl];
lbl = [[UILabel alloc] initWithFrame:CGRectMake([MyLocalizedString(@"TOMORROW", @"TOMORROW") sizeWithFont:[UIFont fontWithName:@"Volkswagen-Serial-Medium-Regular" size:21]].width + 15, 41, 200, 30)];
lbl.tag = 2;
lbl.font = [UIFont fontWithName:@"Volkswagen-Regular" size:19];
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
components = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate dateWithTimeIntervalSinceNow:86400]];
[lbl setText:[NSString stringWithFormat:@" %@, %@ %d ",[[[NSLocale currentLocale] localeIdentifier] containSubString:@"he"] ? [[[[NSDate date] dateByAddingDays:1] dayOfTheWeekString] uppercaseString] : [[[[NSDate date] dateByAddingDays:1] threeLetterDayOfTheWeekString] uppercaseString],[NSDate abbriviatedMonthForDate:[[NSDate date] dateByAddingDays:1]],(int)[components day]]];
lbl.textAlignment = NSTextAlignmentCenter;
[lbl sizeToFit];
[[headers objectAtIndex:1] addSubview:lbl];
img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 67, 320, 1)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[[headers objectAtIndex:1] addSubview:img];
img = [[UIImageView alloc] initWithFrame:CGRectMake(lbl.frame.origin.x+2, 40, 1, 19)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 33;
[[headers objectAtIndex:1] addSubview:img];
lbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 38, 300, 30)];
lbl.tag = 2;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:restOfTheWeek];
[[headers objectAtIndex:2] addSubview:lbl];
img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 67, 320, 1)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[[headers objectAtIndex:2] addSubview:img];
lbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 38, 300, 30)];
lbl.tag = 2;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:MyLocalizedString(@"LATER", @"LATER")];
[[headers objectAtIndex:3] addSubview:lbl];
img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 67, 320, 1)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[[headers objectAtIndex:3] addSubview:img];
lbl = (UILabel*)[[headers objectAtIndex:0] viewWithTag:2];
todayWeather = [[UIImageView alloc] initWithFrame:CGRectMake(lbl.frame.size.width + lbl.frame.origin.x-5, 38, 30, 25)];
[[headers objectAtIndex:0] addSubview:todayWeather];
lbl = (UILabel*)[[headers objectAtIndex:1] viewWithTag:2];
tomorrowWeather = [[UIImageView alloc] initWithFrame:CGRectMake(lbl.frame.size.width + lbl.frame.origin.x-5, 38, 30, 25)];
[[headers objectAtIndex:1] addSubview:tomorrowWeather];
[self gotWeather];
}
else{
NSMutableArray* labels = [[self getLabels] valueForKey:@"values"];
CGRect headerFrame, labelFrame, seperatorFrame;
if ([defaults integerForKey:DISPLAY_TYPE]==DisplayTypeNotes) {
headerFrame = CGRectMake(0, 0, 320, 60);
labelFrame = CGRectMake(10, 30, 300, 30);
seperatorFrame = CGRectMake(0, 59, 320, 1);
}else{
headerFrame = CGRectMake(0, 0, 320, 68);
labelFrame = CGRectMake(10, 38, 300, 30);
seperatorFrame = CGRectMake(0, 67, 320, 1);
}
for(int i=0;i<[labels count];i++){
UIView* header = [[UIView alloc] initWithFrame:headerFrame];
header.backgroundColor = [UIColor whiteColor];
UILabel* lbl = [[UILabel alloc] initWithFrame:labelFrame];
lbl.tag = 2;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:[labels objectAtIndex:i]];
[header addSubview:lbl];
UIImageView *img;
img = [[UIImageView alloc] initWithFrame:seperatorFrame];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[header addSubview:img];
[header bringSubviewToFront:lbl];
[headers addObject:header];
}
//add aditonale header for unlabeled tasks\notes
UIView* header = [[UIView alloc] initWithFrame:headerFrame];
header.backgroundColor = [UIColor whiteColor];
UILabel* lbl = [[UILabel alloc] initWithFrame:labelFrame];
lbl.tag = 2;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:MyLocalizedString(@"Not Labeled", @"Not Labeled")];
[header addSubview:lbl];
UIImageView *img;
img = [[UIImageView alloc] initWithFrame:seperatorFrame];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[header addSubview:img];
[headers insertObject:header atIndex:0];
}
}
Thread : Crashed: com.apple.main-thread
0 UIKit 0x000000018c4f22a0 -[_UIViewAdditiveAnimationAction runActionForKey:object:arguments:] + 640
1 UIKit 0x000000018c4f228c -[_UIViewAdditiveAnimationAction runActionForKey:object:arguments:] + 620
2 QuartzCore 0x000000018bb80198 CA::Layer::set_bounds(CA::Rect const&, bool) + 408
3 QuartzCore 0x000000018bb7ff78 -[CALayer setBounds:] + 104
4 UIKit 0x000000018c70fa50 -[_UILabelLayer setBounds:] + 56
5 QuartzCore 0x000000018bb80c58 -[CALayer setFrame:] + 488
6 UIKit 0x000000018c70f9e4 -[_UILabelLayer setFrame:] + 56
7 UIKit 0x000000018c22de0c -[UIView(Geometry) setFrame:] + 292
8 UIKit 0x000000018c23d69c -[UILabel setFrame:] + 140
9 UIKit 0x000000018c23ea88 -[UIView(Geometry) sizeToFit] + 248
10 24me 0x00000001001e292c -[ViewController setUpHeaders:] (ViewController.m:3412)
11 24me 0x00000001001dfcac -[ViewController groupByTime] (ViewController.m:3146)
12 24me 0x00000001001df6a0 -[ViewController group] (ViewController.m:3071)
13 Foundation 0x0000000188970ea8 __NSFireDelayedPerform + 424
14 CoreFoundation 0x0000000187a6a210 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
15 CoreFoundation 0x0000000187a69ec0 __CFRunLoopDoTimer + 888
16 CoreFoundation 0x0000000187a6790c __CFRunLoopRun + 1372
17 CoreFoundation 0x0000000187995664 CFRunLoopRunSpecific + 396
18 GraphicsServices 0x0000000190acf5a4 GSEventRunModal + 168
19 UIKit 0x000000018c29a4f8 UIApplicationMain + 1488
20 24me 0x00000001000642bc main (main.m:16)
21 libdyld.dylib 0x000000019875ea08 start + 4
最佳答案
我修改了一些您的代码并添加了注释。注意突出显示的部分。
-(void)setUpHeaders:(NSInteger)fortype{
headers = [NSMutableArray array];
if(fortype == GROUP_BY_TIME){
for(int i=0;i<4;i++){
UIView* header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 68)];
header.backgroundColor = [UIColor whiteColor];
[headers addObject:header];
}
int today = (int)[NSDate dayOfTheWeekOfDate:[NSDate date]];
int firstDayOfTheWeek = (int)[defaults integerForKey:FIRST_DAY_IF_THE_WEEK_KEY];
NSString* restOfTheWeek = nil;
if(today == ((firstDayOfTheWeek + 4) % 7) + 1) restOfTheWeek = MyLocalizedString(@"THE COMING WEEK", @"THE COMING WEEK") ;
else if(today == ((firstDayOfTheWeek + 5) % 7) + 1) restOfTheWeek = MyLocalizedString(@"REST OF NEXT WEEK", @"REST OF NEXT WEEK") ;
else restOfTheWeek = MyLocalizedString(@"REST OF THE WEEK", @"REST OF THE WEEK") ;
UILabel* lbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 38, 300, 30)];
lbl.tag = 22;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:MyLocalizedString(@"TODAY", @"TODAY") ];
[[headers objectAtIndex:0] addSubview:lbl]; // take note of this part [lbl sizeToFit]; // always add view to its parent before calling 'sizeToFit' or it will crash
lbl = [[UILabel alloc] initWithFrame:CGRectMake([MyLocalizedString(@"TODAY", @"TODAY") sizeWithFont:[UIFont fontWithName:@"Volkswagen-Serial-Medium-Regular" size:21]].width + 15, 41, 300, 30)];
lbl.tag = 2;
lbl.font = [UIFont fontWithName:@"Volkswagen-Regular" size:19];
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
NSDateComponents *components = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate date]];
[lbl setText:[NSString stringWithFormat:@" %@, %@ %d ",[[[NSLocale currentLocale] localeIdentifier] containSubString:@"he"] ? [[[NSDate date] dayOfTheWeekString] uppercaseString] : [[[NSDate date] threeLetterDayOfTheWeekString] uppercaseString],[NSDate abbriviatedMonthForDate:[NSDate date]],(int)[components day]]];
lbl.textAlignment = NSTextAlignmentCenter;
[[headers objectAtIndex:0] addSubview:lbl]; // take note of this part [lbl sizeToFit]; // always add view to its parent before calling 'sizeToFit' or it will crash
UIImageView *img;
img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 67, 320, 1)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[[headers objectAtIndex:0] addSubview:img];
img = [[UIImageView alloc] initWithFrame:CGRectMake(lbl.frame.origin.x+2, 40, 1, 19)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 33;
[[headers objectAtIndex:0] addSubview:img];
lbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 38, 300, 30)];
lbl.tag = 22;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:MyLocalizedString(@"TOMORROW", @"TOMORROW")];
[[headers objectAtIndex:1] addSubview:lbl]; // take note of this part [lbl sizeToFit]; // always add view to its parent before calling 'sizeToFit' or it will crash
lbl = [[UILabel alloc] initWithFrame:CGRectMake([MyLocalizedString(@"TOMORROW", @"TOMORROW") sizeWithFont:[UIFont fontWithName:@"Volkswagen-Serial-Medium-Regular" size:21]].width + 15, 41, 200, 30)];
lbl.tag = 2;
lbl.font = [UIFont fontWithName:@"Volkswagen-Regular" size:19];
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
components = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate dateWithTimeIntervalSinceNow:86400]];
[lbl setText:[NSString stringWithFormat:@" %@, %@ %d ",[[[NSLocale currentLocale] localeIdentifier] containSubString:@"he"] ? [[[[NSDate date] dateByAddingDays:1] dayOfTheWeekString] uppercaseString] : [[[[NSDate date] dateByAddingDays:1] threeLetterDayOfTheWeekString] uppercaseString],[NSDate abbriviatedMonthForDate:[[NSDate date] dateByAddingDays:1]],(int)[components day]]];
lbl.textAlignment = NSTextAlignmentCenter;
[[headers objectAtIndex:1] addSubview:lbl]; // take note of this part [lbl sizeToFit]; // always add view to its parent before calling 'sizeToFit' or it will crash
img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 67, 320, 1)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[[headers objectAtIndex:1] addSubview:img];
img = [[UIImageView alloc] initWithFrame:CGRectMake(lbl.frame.origin.x+2, 40, 1, 19)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 33;
[[headers objectAtIndex:1] addSubview:img];
lbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 38, 300, 30)];
lbl.tag = 2;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:restOfTheWeek];
[[headers objectAtIndex:2] addSubview:lbl];
img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 67, 320, 1)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[[headers objectAtIndex:2] addSubview:img];
lbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 38, 300, 30)];
lbl.tag = 2;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:MyLocalizedString(@"LATER", @"LATER")];
[[headers objectAtIndex:3] addSubview:lbl];
img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 67, 320, 1)];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[[headers objectAtIndex:3] addSubview:img];
lbl = (UILabel*)[[headers objectAtIndex:0] viewWithTag:2];
todayWeather = [[UIImageView alloc] initWithFrame:CGRectMake(lbl.frame.size.width + lbl.frame.origin.x-5, 38, 30, 25)];
[[headers objectAtIndex:0] addSubview:todayWeather];
lbl = (UILabel*)[[headers objectAtIndex:1] viewWithTag:2];
tomorrowWeather = [[UIImageView alloc] initWithFrame:CGRectMake(lbl.frame.size.width + lbl.frame.origin.x-5, 38, 30, 25)];
[[headers objectAtIndex:1] addSubview:tomorrowWeather];
[self gotWeather];
}
else{
NSMutableArray* labels = [[self getLabels] valueForKey:@"values"];
CGRect headerFrame, labelFrame, seperatorFrame;
if ([defaults integerForKey:DISPLAY_TYPE]==DisplayTypeNotes) {
headerFrame = CGRectMake(0, 0, 320, 60);
labelFrame = CGRectMake(10, 30, 300, 30);
seperatorFrame = CGRectMake(0, 59, 320, 1);
}else{
headerFrame = CGRectMake(0, 0, 320, 68);
labelFrame = CGRectMake(10, 38, 300, 30);
seperatorFrame = CGRectMake(0, 67, 320, 1);
}
for(int i=0;i<[labels count];i++){
UIView* header = [[UIView alloc] initWithFrame:headerFrame];
header.backgroundColor = [UIColor whiteColor];
UILabel* lbl = [[UILabel alloc] initWithFrame:labelFrame];
lbl.tag = 2;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:[labels objectAtIndex:i]];
[header addSubview:lbl];
UIImageView *img;
img = [[UIImageView alloc] initWithFrame:seperatorFrame];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[header addSubview:img];
[header bringSubviewToFront:lbl];
[headers addObject:header];
}
//add aditonale header for unlabeled tasks\notes
UIView* header = [[UIView alloc] initWithFrame:headerFrame];
header.backgroundColor = [UIColor whiteColor];
UILabel* lbl = [[UILabel alloc] initWithFrame:labelFrame];
lbl.tag = 2;
lbl.font = XX_LARGE_VOLKS_FONT;
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[UIColor darkGrayColor]];
[lbl setText:MyLocalizedString(@"Not Labeled", @"Not Labeled")];
[header addSubview:lbl];
UIImageView *img;
img = [[UIImageView alloc] initWithFrame:seperatorFrame];
[img setBackgroundColor:[UIColor darkGrayColor]];
img.alpha = 0.5;
img.tag = 3;
[header addSubview:img];
[headers insertObject:header atIndex:0];
}
}
关于objective-c - IOS8 - [UIlabel sizeToFit] 导致 EXC_BAD_ACCESS KERN_INVALID_ADDRESS 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26461664/
我不确定为什么会收到此错误,而且我无法查明原因。虽然这只发生在设备上,但模拟器按预期运行无错误。谁能理解这个崩溃日志? Exception Type: EXC_BAD_ACCESS (SIGSEGV
我经常崩溃,你能帮我找出解决办法吗 Incident Identifier: BC2870F3-4119-462B-9B2E-2236E403E7C2 CrashReporter Key: 7d9
我在尝试运行调试器时不断收到此错误: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INV
我有时会遇到这个错误: Thread : Crashed: com.apple.root.default-priority 0 libobjc.A.dylib 0x00
谁能告诉我如何解决我的应用程序中出现的崩溃。我无法找到为什么会发生这次崩溃。我没有得到任何线索。我搜索我的项目以找到“objectIsKindOfClass”,但我没有使用过这种方法。 最佳答案 为了
所以与此类似recently posted question ,我在将 Amazon 的 AWS Obj-C 库与我的 Swift 应用程序集成时遇到问题。我有一个 NSOperation,它使用 T
我有一个奇怪的问题。我收到一个错误报告,说该应用程序崩溃与方向更改有关。问题是我还没有在应用程序代码中注册任何定向事件。我唯一与方向变化有关的是: - (BOOL)shouldAutorotateTo
我在发布的应用程序中偶尔会发生崩溃,并且从崩溃报告中知道它发生的行和崩溃类型 - EXC_BAD_ACCESS (SIGSEGV) KERN_INVALID_ADDRESS - 但我不知道内存如何变得
使用 Crashlytics,我看到我的一小部分用户因错误 EXC_BAD_ACCESS KERN_INVALID_ADDRESS 而崩溃,在以下行中: [[UIApplication sharedA
我正在用 c 语言编写一个程序,该程序严重依赖于正则表达式,我执行它们的机制在 99% 的时间都有效,但它每隔一段时间就会让程序崩溃,我很困惑为什么会这样。 New_Sifter() 采用其正则表达式
我收到这个错误,这可能是什么??? 程序收到信号 EXC_BAD_ACCESS,无法访问内存。原因:KERN_INVALID_ADDRESS 地址:0x0000000000000000strlen (
我看到类方法的 EXC_BAD_ACCESS KERN_INVALID_ADDRESS。 据我所知,我不应该在类/静态方法中看到这一点。 我错过了什么吗? 堆栈跟踪: Thread : Crashed
我使用 Xcode 6.3.2 开发了一个 iPad 应用程序。我将我的应用程序提交到 App Store 进行审核,但由于崩溃而被拒绝。以下是来自 iTunes 的崩溃报告。 Incident Id
我的应用程序通过 Xcode 在 Debug模式下运行良好,但每当通过 TestFlight 下载时,它就会崩溃并出现以下错误:EXC_BAD_ACCESS KERN_INVALID_ADDRESS
MyApp 在 98% 的情况下运行良好,但有时会崩溃。太随意了。 崩溃报告显示以下内容。 Thread : Crashed: com.apple.main-thread 0 libobjc.A.d
iPhone 操作系统上的 KERN_INVALID_ADDRESS 和 KERN_PROTECTION_FAILURE 有什么区别? 我有两个来自临时 Beta 测试人员的崩溃报告,它们相隔 5 分
我不断通过 Crashlytics 收到有关此崩溃的报告,但我不知道如何找出问题所在,因为堆栈跟踪不会在任何地方触及我的代码。我能做些什么?如何找到问题的根源? EXC_BAD_ACCESS KERN
我在 Unity (2019.2.16f1) 上开发了一个游戏,我有一个 大问题 : 1 秒后提交到 App Store 的构建崩溃(启动时) 更多信息: 我编写了一些 c# 脚本,但大部分游戏都使用
我正在尝试将图像更改为黑白,这些图像是从服务调用中提供的,一旦获得图像,我就会应用黑色滤镜将它们更改为黑白。我只在 iOS 13 上遇到过这个悬空指针异常,其他 iOS 版本没有这个问题。 这是代码:
我收到以下错误。 EXC_BAD_ACCESS KERN_INVALID_ADDRESS [UITextField keyboardInputChangedSelection:] 直到这份最新的崩溃
我是一名优秀的程序员,十分优秀!