【发布时间】:2012-04-06 06:12:21
【问题描述】:
我正在尝试实现 SVProgressHUD 活动指示器。我将这些类复制到我的项目中,并将以下代码添加到我的 appDelegate 中,但无法弄清楚它崩溃的原因。
我发现他们出现以下错误,但不知道在哪里修复它:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SVProgressHUD", referenced from:
objc-class-ref in QuotesAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
代码如下:
#import "SVProgressHUD.h"
@implementation QuotesAppDelegate
- (void)startLoading
{
//call this in your app delegate instead of setting window.rootViewController to your main view controller
//you can show a UIActivityIndiocatorView here or something if you like
[SVProgressHUD show];
[self performSelectorInBackground:@selector(loadInBackground) withObject:nil];
}
- (void)loadInBackground
{
//do your loading here
//this is in the background, so don't try to access any UI elements
[self populateFromDatabase];
[SVProgressHUD dismiss];
[self performSelectorOnMainThread:@selector(finishedLoading) withObject:nil waitUntilDone:NO];
}
- (void)finishedLoading
{
//back on the main thread now, it's safe to show your view controller
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[self copyDatabaseIfNeeded];
[self startLoading];
}
【问题讨论】:
-
您还记得将 QuartzCore 框架添加到您的项目中吗?
-
是的,添加了 QuartzCore 框架以及 CoreGraphics.framework
标签: iphone ios multithreading