Ios MBHUD实现崩溃
我已将MBProgressHUD实施到我的objective-c项目中,当progressHUD启动时,我的应用程序崩溃。这是我的日志Ios MBHUD实现崩溃,ios,objective-c,cocoapods,mbprogresshud,Ios,Objective C,Cocoapods,Mbprogresshud,我已将MBProgressHUD实施到我的objective-c项目中,当progressHUD启动时,我的应用程序崩溃。这是我的日志 0 CoreFoundation 0x0000000102b35f45 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x0000000101b08deb objc_exception_throw + 48 2 CoreFo
0 CoreFoundation 0x0000000102b35f45 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101b08deb objc_exception_throw + 48
2 CoreFoundation 0x0000000102b3e56d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000102a8beea ___forwarding___ + 970
4 CoreFoundation 0x0000000102a8ba98 _CF_forwarding_prep_0 + 120
5 EyeQueExam 0x0000000100e80762 -[MBProgressHUD launchExecution] + 82
6 Foundation 0x0000000101792eab __NSThread__start__ + 1198
7 libsystem_pthread.dylib 0x000000010568e05a _pthread_body + 131
8 libsystem_pthread.dylib 0x000000010568dfd7 _pthread_body + 0
9 libsystem_pthread.dylib 0x000000010568b3ed thread_start + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
此外,这行代码还获取信号SIGABRT错误:
[targetForExecution performSelector:methodForExecution withObject:objectForExecution];
编辑:
// MBProgressHUD
HUD = [[MBProgressHUD alloc] initWithView:self.view];
HUD.labelText = @"Uploading to Cloud...";
HUD.detailsLabelText = @"Just relax";
HUD.mode = MBProgressHUDModeAnnularDeterminate;
[self.view addSubview:HUD];
[HUD show:YES];
[HUD showWhileExecuting:@selector(load) onTarget:self withObject:nil animated:YES];
-(NSArray*)加载:(NSString*)组件名称
{
浮动进度=0.0;
而(进度<1.0){
进度+=0.01;
HUD.progress=进度;
美国LEEP(50000);
}
}
尝试编辑此代码:
[HUD showWhileExecuting:@selector(load) onTarget:self withObject:nil animated:YES];
致:
请尝试编辑此代码:
[HUD showWhileExecuting:@selector(load) onTarget:self withObject:nil animated:YES];
致:
在
(void)
您的代码:
- (void) load {
{
float progress = 0.0;
while (progress < 1.0) {
progress += 0.01;
HUD.progress = progress;
usleep(50000);
}
}
-(无效)加载{
{
浮动进度=0.0;
而(进度<1.0){
进度+=0.01;
HUD.progress=进度;
美国LEEP(50000);
}
}
在(void)
您的代码:
- (void) load {
{
float progress = 0.0;
while (progress < 1.0) {
progress += 0.01;
HUD.progress = progress;
usleep(50000);
}
}
-(无效)加载{
{
浮动进度=0.0;
而(进度<1.0){
进度+=0.01;
HUD.progress=进度;
美国LEEP(50000);
}
}
你能展示你是如何使用它的吗?它在运行时以一种常见的方式崩溃。对象不响应该选择器。你如何使用MBProgressHUD
?只是用我正在使用的一些代码更新了代码…试试看,它比MBProgressHUD好。你能展示你是如何使用它的吗?它在运行时以一种常见的方式崩溃。对象不会恢复切换到该选择器。如何使用MBProgressHUD
?刚刚用我正在使用的一些代码更新了代码。试试这个,它比MB@fafafa好的。我会找到另一种方法。关于HUD
变量,你在哪里定义它?@fafafa好的。我会找到另一种方法。关于HUD
变量,你在哪里定义是吗?
- (void) load {
{
float progress = 0.0;
while (progress < 1.0) {
progress += 0.01;
HUD.progress = progress;
usleep(50000);
}
}