MBProgressHUD armv7 error

让人想犯罪 __ 提交于 2019-12-30 02:53:19

问题


i'm trying to use MBProgressHUD. i added header an .m to project, imported header in class and call MBProgressHUD from an ibaction in this way:

-(IBAction)submitForm:(id)sender{
    MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:self.view];
    [self.view addSubview:HUD];
    HUD.labelText = @"Connecting";
    [HUD show:YES];
}

when i build project it happens an error:

Undefined symbols for architecture armv7:
    "_OBJC_CLASS_$_MBProgressHUD", referenced from:
    objc-class-ref in FormViewController.o
    ld: symbol(s) not found for architecture armv7
    collect2: ld returned 1 exit status

How can i fix it? can you help me?


回答1:


In your Xcode project, select your MBProgressHUD.m file in the list of files (along the left edge of the workspace) and look at the File Inspector for that file.

Make sure the checkbox is ON for your project in the "Target Membership" setting.




回答2:


Just a guess, but check to make sure that MBProgressHUD.m is added to your Build Sources build phase.




回答3:


This is weird error with XCode import, Delete MBProgressHUD (Reference ONLY) then add back to XCode.

if it doesn't work Few Extra steps.
1. Delete MBProgressHUD (Reference ONLY).
2. Comment the code related to MBProgressHUD.
3. Build.
4. Add MBProgressHUD to XCode.
5. Uncomment code.
6. Build.




回答4:


try to add CoreGraphics.framework



来源:https://stackoverflow.com/questions/8852249/mbprogresshud-armv7-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!