- 卷积神经网络学习笔记——ZFNet(Tensorflow实现)
- 24年3月使用VS22编译TelegramDesktop
- STM32中RFID模块(MFRC522)简单应用
- java反序列化-CC1
现代移动应用的用户体验依赖于其稳定性和可靠性。然而,在开发过程中,我们时常会遇到各种崩溃问题。崩溃不仅会影响用户的使用体验,还可能损害应用的声誉。因此,本文将详细介绍一个名为CrashPrevention的工具类,它能够为iOS开发者提供多方面的崩溃预防措施,借助该工具类,开发者能够有效减少崩溃的发生,并提升应用的稳定性.
CrashPrevention是一个易于集成的工具类,专为iOS应用中的多种常见崩溃情况提供预防措施。通过调用相关方法,开发者可以开启针对数组操作、字典操作、未识别的选择器、通知中心、键值观察(KVO)、字符串操作、多线程操作以及UI线程操作的保护机制。特别值得一提的是,CrashPrevention让开发者可以通过一个全局的 isDebug 标志,灵活控制是否启用这些崩溃预防措施.
首先,我们来看一下CrashPrevention的头文件,其中定义了所有的预防方法:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface CrashPrevention : NSObject
// 设置是否在 Debug 模式中启用崩溃预防
+ (void)setDebugMode:(BOOL)isDebug;
// 启用所有崩溃保护
+ (void)enableAllCrashPrevention;
// 启用各类崩溃保护
+ (void)enableArrayProtection;
+ (void)enableDictionaryProtection;
+ (void)enableSelectorProtection;
+ (void)enableNotificationProtection;
+ (void)enableKVOCrashProtection;
+ (void)enableStringProtection;
+ (void)enableThreadSafetyProtection;
+ (void)enableUIThreadProtection;
@end
接下来,我们深入了解实现文件的设计思路和具体代码.
@implementation CrashPrevention
// 用于记录是否在 Debug 模式下启用崩溃预防
static BOOL debugModeEnabled = NO;
// 设置是否在 Debug 模式中启用崩溃预防
+ (void)setDebugMode:(BOOL)isDebug {
debugModeEnabled = isDebug;
}
通过 static BOOL debugModeEnabled,我们可以记录是否启用调试模式,基于此标志决定是否启用崩溃预防功能.
+ (void)enableAllCrashPrevention {
if (!debugModeEnabled) {
return;
}
[self enableArrayProtection];
[self enableDictionaryProtection];
[self enableSelectorProtection];
[self enableNotificationProtection];
[self enableKVOCrashProtection];
[self enableStringProtection];
[self enableThreadSafetyProtection];
[self enableUIThreadProtection];
}
该方法通过检查 debugModeEnabled 标志,决定是否依次启用各类崩溃保护.
+ (void)enableArrayProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:NSClassFromString(@"__NSArrayI")
original:@selector(objectAtIndex:)
swizzled:@selector(safe_objectAtIndex:)];
[self swizzleInstanceMethod:NSClassFromString(@"__NSArrayM")
original:@selector(objectAtIndex:)
swizzled:@selector(safe_objectAtIndex:)];
});
}
- (id)safe_objectAtIndex:(NSUInteger)index {
if (index < self.count) {
return [self safe_objectAtIndex:index];
} else {
@try {
NSLog(@"Array index out of bound: %lu", (unsigned long)index);
} @catch (NSException *exception) {
// 处理异常
}
return nil;
}
}
通过 Method Swizzling,我们可以将数组的 objectAtIndex: 方法替换为安全版本。在越界的情况下,返回 nil 并记录日志,而不会崩溃.
+ (void)enableDictionaryProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:NSClassFromString(@"__NSDictionaryI")
original:@selector(objectForKey:)
swizzled:@selector(safe_objectForKey:)];
});
}
- (id)safe_objectForKey:(id)key {
if (key) {
return [self safe_objectForKey:key];
} else {
@try {
NSLog(@"Attempted to access dictionary with nil key");
} @catch (NSException *exception) {
// 处理异常
}
return nil;
}
}
类似地,通过 Method Swizzling,我们可以将 objectForKey: 方法替换为安全版本,防止使用 nil 作为键值时的崩溃.
+ (void)enableSelectorProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Method forwardMethod = class_getInstanceMethod([self class], @selector(forwardingMethod:));
class_addMethod([self class], NSSelectorFromString(@"unrecognizedSelectorHandler"), method_getImplementation(forwardMethod), method_getTypeEncoding(forwardMethod));
});
}
- (void)forwardingMethod:(SEL)aSelector {}
+ (BOOL)resolveInstanceMethod:(SEL)sel {
if (!debugModeEnabled) {
return [super resolveInstanceMethod:sel];
}
class_addMethod([self class], sel, class_getMethodImplementation([self class], @selector(forwardingMethod:)), "v@:");
return YES;
}
通过添加一个默认的 forwardingMethod: ,我们防止调用未实现的方法时崩溃.
+ (void)enableNotificationProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:[NSNotificationCenter class]
original:@selector(addObserver:selector:name:object:)
swizzled:@selector(safe_addObserver:selector:name:object:)];
[self swizzleInstanceMethod:[NSNotificationCenter class]
original:@selector(removeObserver:name:object:)
swizzled:@selector(safe_removeObserver:name:object:)];
});
}
- (void)safe_addObserver:(NSObject *)observer selector:(SEL)aSelector name:(NSString *)aName object:(id)anObject {
if (observer) {
[[NSNotificationCenter defaultCenter] safe_addObserver:observer selector:aSelector name:aName object:anObject];
} else {
@try {
NSLog(@"Attempted to add a nil observer for name: %@", aName);
} @catch (NSException *exception) {
// 处理异常
}
}
}
- (void)safe_removeObserver:(NSObject *)observer name:(NSString *)aName object:(id)anObject {
if (observer) {
[[NSNotificationCenter defaultCenter] safe_removeObserver:observer name:aName object:anObject];
} else {
@try {
NSLog(@"Attempted to remove a nil observer for name: %@", aName);
} @catch (NSException *exception) {
// 处理异常
}
}
}
在添加和移除观察者时进行空检查,防止空观察者导致的崩溃.
+ (void)enableKVOCrashProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:[NSObject class]
original:@selector(addObserver:forKeyPath:options:context:)
swizzled:@selector(safe_addObserver:forKeyPath:options:context:)];
[self swizzleInstanceMethod:[NSObject class]
original:@selector(removeObserver:forKeyPath:)
swizzled:@selector(safe_removeObserver:forKeyPath:)];
});
}
- (void)safe_addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context {
if (observer && keyPath) {
[self safe_addObserver:observer forKeyPath:keyPath options:options context:context];
} else {
@try {
NSLog(@"Attempted to add observer with nil observer or key path: %@", keyPath);
} @catch (NSException *exception) {
// 处理异常
}
}
}
- (void)safe_removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath {
if (observer && keyPath) {
[self safe_removeObserver:observer forKeyPath:keyPath];
} else {
@try {
NSLog(@"Attempted to remove observer with nil observer or key path: %@", keyPath);
} @catch (NSException *exception) {
// 处理异常
}
}
}
在添加和移除KVO时进行必要检查,确保参数合法,防止崩溃.
+ (void)enableStringProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:NSClassFromString(@"__NSCFConstantString")
original:@selector(substringFromIndex:)
swizzled:@selector(safe_substringFromIndex:)];
});
}
- (NSString *)safe_substringFromIndex:(NSUInteger)from {
if (from <= self.length) {
return [self safe_substringFromIndex:from];
} else {
@try {
NSLog(@"String index out of bound: %lu", (unsigned long)from);
} @catch (NSException *exception) {
// 处理异常
}
return nil;
}
}
通过交换NSString的相关方法,确保在越界访问时返回 nil 并记录日志,从而避免崩溃.
+ (void)enableThreadSafetyProtection {
if (!debugModeEnabled) {
return;
}
// 实现是与具体使用场景相关的,需要结合项目实际情况实现
}
这部分的实现高度依赖于具体的使用场景,比如可以使用 dispatch_barrier_async、NSLock 等技术实现.
+ (void)enableUIThreadProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:[UIView class]
original:@selector(setNeedsLayout)
swizzled:@selector(safe_setNeedsLayout)];
});
}
- (void)safe_setNeedsLayout {
if ([NSThread isMainThread]) {
[self safe_setNeedsLayout];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[self safe_setNeedsLayout];
});
@try {
NSLog(@"setNeedsLayout was called off the main thread. Fixed by dispatching to main queue.");
} @catch (NSException *exception) {
// 处理异常
}
}
}
确保UI操作总在主线程进行,如果不是,则调度到主线程执行,并记录警告日志.
#pragma mark - Method Swizzling
+ (void)swizzleInstanceMethod:(Class)cls original:(SEL)originalSelector swizzled:(SEL)swizzledSelector {
Method originalMethod = class_getInstanceMethod(cls, originalSelector);
Method swizzledMethod = class_getInstanceMethod(cls, swizzledSelector);
BOOL didAddMethod = class_addMethod(cls, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod));
if (didAddMethod) {
class_replaceMethod(cls, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
} else {
method_exchangeImplementations(originalMethod, swizzledMethod);
}
}
@end
核心方法交换逻辑,通过 Method Swizzling 替换原有的方法实现.
在应用启动时初始化CrashPrevention,并设置是否启用调试模式:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// 设置 Debug 模式
#ifdef DEBUG
[CrashPrevention setDebugMode:YES];
#else
[CrashPrevention setDebugMode:NO];
#endif
[CrashPrevention enableAllCrashPrevention];
return YES;
}
CrashPrevention工具类为iOS开发者提供了多个方面的崩溃预防措施,通过简单调用,即可为数组、字典、未识别选择器、通知中心、KVO、字符串、多线程和UI线程的操作提供全面的保护。特别是通过 isDebug 标志,让开发者可以灵活控制这些预防措施在调试阶段和正式发布中的启用状态。借助这一工具类,开发者能够有效减少崩溃问题的发生,提升应用的稳定性和用户体验.
最后附上完整代码:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface CrashPrevention : NSObject
// 设置是否在 Debug 模式中启用崩溃预防
+ (void)setDebugMode:(BOOL)isDebug;
// 启用所有崩溃保护
+ (void)enableAllCrashPrevention;
// 启用各类崩溃保护
+ (void)enableArrayProtection;
+ (void)enableDictionaryProtection;
+ (void)enableSelectorProtection;
+ (void)enableNotificationProtection;
+ (void)enableKVOCrashProtection;
+ (void)enableStringProtection;
+ (void)enableThreadSafetyProtection;
+ (void)enableUIThreadProtection;
@end
#import "CrashPrevention.h"
#import <objc/runtime.h>
@implementation CrashPrevention
// 用于记录是否在 Debug 模式下启用崩溃预防
static BOOL debugModeEnabled = NO;
// 设置是否在 Debug 模式中启用崩溃预防
+ (void)setDebugMode:(BOOL)isDebug {
debugModeEnabled = isDebug;
}
// 启用所有崩溃保护
+ (void)enableAllCrashPrevention {
if (!debugModeEnabled) {
return;
}
[self enableArrayProtection];
[self enableDictionaryProtection];
[self enableSelectorProtection];
[self enableNotificationProtection];
[self enableKVOCrashProtection];
[self enableStringProtection];
[self enableThreadSafetyProtection];
[self enableUIThreadProtection];
}
#pragma mark - Array Protection
+ (void)enableArrayProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:NSClassFromString(@"__NSArrayI")
original:@selector(objectAtIndex:)
swizzled:@selector(safe_objectAtIndex:)];
[self swizzleInstanceMethod:NSClassFromString(@"__NSArrayM")
original:@selector(objectAtIndex:)
swizzled:@selector(safe_objectAtIndex:)];
});
}
- (id)safe_objectAtIndex:(NSUInteger)index {
if (index < self.count) {
return [self safe_objectAtIndex:index];
} else {
@try {
NSLog(@"Array index out of bound: %lu", (unsigned long)index);
} @catch (NSException *exception) {
// 处理异常
} @finally {
return nil;
}
}
}
#pragma mark - Dictionary Protection
+ (void)enableDictionaryProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:NSClassFromString(@"__NSDictionaryI")
original:@selector(objectForKey:)
swizzled:@selector(safe_objectForKey:)];
[self swizzleInstanceMethod:NSClassFromString(@"__NSDictionaryM")
original:@selector(objectForKey:)
swizzled:@selector(safe_objectForKey:)];
});
}
- (id)safe_objectForKey:(id)key {
if (key) {
return [self safe_objectForKey:key];
} else {
@try {
NSLog(@"Attempted to access dictionary with nil key");
} @catch (NSException *exception) {
// 处理异常
} @finally {
return nil;
}
}
}
#pragma mark - Selector Protection
+ (void)enableSelectorProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Method forwardMethod = class_getInstanceMethod([self class], @selector(forwardingMethod:));
class_addMethod([self class], NSSelectorFromString(@"unrecognizedSelectorHandler"), method_getImplementation(forwardMethod), method_getTypeEncoding(forwardMethod));
});
}
- (void)forwardingMethod:(SEL)aSelector {}
+ (BOOL)resolveInstanceMethod:(SEL)sel {
if (!debugModeEnabled) {
return [super resolveInstanceMethod:sel];
}
class_addMethod([self class], sel, class_getMethodImplementation([self class], @selector(forwardingMethod:)), "v@:");
return YES;
}
#pragma mark - Notification Protection
+ (void)enableNotificationProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:[NSNotificationCenter class]
original:@selector(addObserver:selector:name:object:)
swizzled:@selector(safe_addObserver:selector:name:object:)];
[self swizzleInstanceMethod:[NSNotificationCenter class]
original:@selector(removeObserver:name:object:)
swizzled:@selector(safe_removeObserver:name:object:)];
[self swizzleInstanceMethod:[NSNotificationCenter class]
original:@selector(removeObserver:)
swizzled:@selector(safe_removeObserver:)];
});
}
- (void)safe_addObserver:(NSObject *)observer selector:(SEL)aSelector name:(NSString *)aName object:(id)anObject {
if (observer) {
[[NSNotificationCenter defaultCenter] safe_addObserver:observer selector:aSelector name:aName object:anObject];
} else {
@try {
NSLog(@"Attempted to add a nil observer for name: %@", aName);
} @catch (NSException *exception) {
// 处理异常
} @finally {
// 什么也不做
}
}
}
- (void)safe_removeObserver:(NSObject *)observer {
if (observer) {
[[NSNotificationCenter defaultCenter] safe_removeObserver:observer];
} else {
@try {
NSLog(@"Attempted to remove a nil observer");
} @catch (NSException *exception) {
// 处理异常
} @finally {
// 什么也不做
}
}
}
- (void)safe_removeObserver:(NSObject *)observer name:(NSString *)aName object:(id)anObject {
if (observer) {
[[NSNotificationCenter defaultCenter] safe_removeObserver:observer name:aName object:anObject];
} else {
@try {
NSLog(@"Attempted to remove a nil observer for name: %@", aName);
} @catch (NSException *exception) {
// 处理异常
} @finally {
// 什么也不做
}
}
}
#pragma mark - KVO Protection
+ (void)enableKVOCrashProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:[NSObject class]
original:@selector(addObserver:forKeyPath:options:context:)
swizzled:@selector(safe_addObserver:forKeyPath:options:context:)];
[self swizzleInstanceMethod:[NSObject class]
original:@selector(removeObserver:forKeyPath:)
swizzled:@selector(safe_removeObserver:forKeyPath:)];
});
}
- (void)safe_addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context {
if (observer && keyPath) {
[self safe_addObserver:observer forKeyPath:keyPath options:options context:context];
} else {
@try {
NSLog(@"Attempted to add observer with nil observer or key path: %@", keyPath);
} @catch (NSException *exception) {
// 处理异常
} @finally {
// 什么也不做
}
}
}
- (void)safe_removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath {
if (observer && keyPath) {
[self safe_removeObserver:observer forKeyPath:keyPath];
} else {
@try {
NSLog(@"Attempted to remove observer with nil observer or key path: %@", keyPath);
} @catch (NSException *exception) {
// 处理异常
} @finally {
// 什么也不做
}
}
}
#pragma mark - String Protection
+ (void)enableStringProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:NSClassFromString(@"__NSCFConstantString")
original:@selector(substringFromIndex:)
swizzled:@selector(safe_substringFromIndex:)];
[self swizzleInstanceMethod:NSClassFromString(@"__NSCFConstantString")
original:@selector(substringToIndex:)
swizzled:@selector(safe_substringToIndex:)];
[self swizzleInstanceMethod:NSClassFromString(@"__NSCFConstantString")
original:@selector(substringWithRange:)
swizzled:@selector(safe_substringWithRange:)];
});
}
- (NSString *)safe_substringFromIndex:(NSUInteger)from {
if (from <= self.length) {
return [self safe_substringFromIndex:from];
} else {
@try {
NSLog(@"String index out of bound: %lu", (unsigned long)from);
} @catch (NSException *exception) {
// 处理异常
} @finally {
return nil;
}
}
}
- (NSString *)safe_substringToIndex:(NSUInteger)to {
if (to <= self.length) {
return [self safe_substringToIndex:to];
} else {
@try {
NSLog(@"String index out of bound: %lu", (unsigned long)to);
} @catch (NSException *exception) {
// 处理异常
} @finally {
return nil;
}
}
}
- (NSString *)safe_substringWithRange:(NSRange)range {
if (range.location + range.length <= self.length) {
return [self safe_substringWithRange:range];
} else {
@try {
NSLog(@"String range out of bound: %@", NSStringFromRange(range));
} @catch (NSException *exception) {
// 处理异常
} @finally {
return nil;
}
}
}
#pragma mark - Thread Safety Protection
+ (void)enableThreadSafetyProtection {
if (!debugModeEnabled) {
return;
}
// 实现是与具体使用场景相关的,需要结合项目实际情况实现
}
#pragma mark - UI Thread Protection
+ (void)enableUIThreadProtection {
if (!debugModeEnabled) {
return;
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self swizzleInstanceMethod:[UIView class]
original:@selector(setNeedsLayout)
swizzled:@selector(safe_setNeedsLayout)];
[self swizzleInstanceMethod:[UIView class]
original:@selector(setNeedsDisplay)
swizzled:@selector(safe_setNeedsDisplay)];
[self swizzleInstanceMethod:[UIView class]
original:@selector(setNeedsDisplayInRect:)
swizzled:@selector(safe_setNeedsDisplayInRect:)];
});
}
- (void)safe_setNeedsLayout {
if ([NSThread isMainThread]) {
[self safe_setNeedsLayout];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[self safe_setNeedsLayout];
});
@try {
NSLog(@"setNeedsLayout was called off the main thread. Fixed by dispatching to main queue.");
} @catch (NSException *exception) {
// 处理异常
} @finally {
// 什么也不做
}
}
}
- (void)safe_setNeedsDisplay {
if ([NSThread isMainThread]) {
[self safe_setNeedsDisplay];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[self safe_setNeedsDisplay];
});
@try {
NSLog(@"setNeedsDisplay was called off the main thread. Fixed by dispatching to main queue.");
} @catch (NSException *exception) {
// 处理异常
} @finally {
// 什么也不做
}
}
}
- (void)safe_setNeedsDisplayInRect:(CGRect)rect {
if ([NSThread isMainThread]) {
[self safe_setNeedsDisplayInRect:rect];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[self safe_setNeedsDisplayInRect:rect];
});
@try {
NSLog(@"setNeedsDisplayInRect: was called off the main thread. Fixed by dispatching to main queue.");
} @catch (NSException *exception) {
// 处理异常
} @finally {
// 什么也不做
}
}
}
#pragma mark - Method Swizzling
+ (void)swizzleInstanceMethod:(Class)cls original:(SEL)originalSelector swizzled:(SEL)swizzledSelector {
Method originalMethod = class_getInstanceMethod(cls, originalSelector);
Method swizzledMethod = class_getInstanceMethod(cls, swizzledSelector);
BOOL didAddMethod = class_addMethod(cls, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod));
if (didAddMethod) {
class_replaceMethod(cls, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
} else {
method_exchangeImplementations(originalMethod, swizzledMethod);
}
}
@end
最后此篇关于iOS开发基础133-崩溃预防的文章就讲到这里了,如果你想了解更多关于iOS开发基础133-崩溃预防的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。
我有一段代码看起来像这样: void update_clock(uint8_t *time_array) { time_t time = *((time_t *) &time_array[0]
应用程序崩溃了 :( 请帮助我.. 在这方面失败了。我找不到错误?该应用程序可以连接到 iTunesConnect 但它会出错。 谁能根据下面的崩溃报告判断问题出在哪里? share_with_app
小二是新来的实习生,作为技术 leader,我给他安排了一个非常简单的练手任务,把前端 markdown 编辑器里上传的图片保存到服务器端,结果他真的就把图片直接保存到了服务器上,这下可把我气坏了,就
我正在创建一个函数,它将目录路径作为参数传递,或者如果它留空,则提示用户输入。 我已经设置了我的 PATH_MAX=100 和 if 语句来检查 if ((strlen(folder path) +
我已将“arial.ttf”文件(从我的/Windows/Fonts 文件夹中获取)加载到内存中,但是将其传递到 FT_New_Memory_Face 时会崩溃(在 FT_Open_Face 中的某处
我正在尝试在我的计算机上的两个控制台之间进行 rtsp 流。 在控制台 1 上,我有: ffmpeg -rtbufsize 100M -re -f dshow -s 320x240 -i video=
我正在尝试使用 scio_beast在一个项目中。我知道它还没有完成,但这并不重要。我已经设法让它工作得很好。 我现在正在尝试连接到 CloudFlare 后面的服务器,我知道我需要 SNI 才能工作
我有一个带有关联宏的下拉列表,如下所示: Sub Drop() If Range("Hidden1!A1") = "1" Then Sheets("Sheet1").Se
我对 bash 很陌生。我要做的就是运行这个nvvp -vm /usr/lib64/jvm/jre-1.8.0/bin/java无需记住最后的路径。我认为 instafix 就是这样做...... n
我在 Windows 上使用 XAMPP 已经两年左右了,它运行完美,没有崩溃没有问题。 (直到四个月前。) 大约四个月前,我们将服务器/系统升级到了更快的规范。 这是旧规范的内容 - Windows
我面临着一个非常烦人的 android 崩溃,它发生在大约 1% 的 PRODUCTION session 中,应用程序始终在后台运行。 Fatal Exception: android.app.Re
尝试使用下面的函数: public void createObjectType() { try { mCloudDB.createObjectType(ObjectTypeIn
由于我正在进行的一个项目,我在 CF11 管理员中弄乱了类路径,我设法使服务器崩溃,以至于我唯一得到的是一个漂亮的蓝屏和 500 错误.我已经检查了日志,我会把我能做的贴在帖子的底部,但我希望有人会启
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 10 个月前关闭。 Improve
我最近从 xcode 3.x 更新到 4.2,当我在 4.2 中运行应用程序时,我遇到了核心数据问题。我还更新到了 iOS 5,所以问题可能就在那里,我不太确定。 这些应用程序在 3.x 中运行良好,
我是一个相对较新的 iPhone 应用程序开发人员,所以我的知识有点粗略,所以如果这是一个微不足道的问题,请原谅我。 我有一个导航应用程序,它通过在navigationController对象上调用p
if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailViewController
你能帮我吗? 我正在设置 UILocalNotification,当我尝试设置其 userInfo 字典时,它崩溃了。 fetchedObjects 包含 88 个对象。 这是代码: NSDi
为什么我的代码中突然出现 NSFastEnumeration Mutation Handler 崩溃。我很茫然为什么会突然出现这个崩溃以及如何解决它。 最佳答案 崩溃错误: **** 由于未捕获的异常
当我从表中删除行时,我的应用程序崩溃了。这是我检测到错误和堆栈跟踪的来源。谢谢! //delete row from database - (void)tableView:(UITableView *
我是一名优秀的程序员,十分优秀!