1

I am getting an Undefined symbol: OBJC_CLASS$_Intro at link time when trying to build.

I can access the class Intro inside a swift file in Xcode using Xcode's intellisense, but it doesn't seem to recognize it at build time. Can someone with more experience with swift and Xcode give me a hand.

class OldLoginViewController: BaseViewController {

    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        
        NotificationCenter.default.addObserver(self, selector: #selector(OldLoginViewController.goIntro), name: NSNotification.Name("ROOTGOINTRO"), object: nil)
     
        ClsUtil.skip(toViewController: self.navigationController!, viewControllerName: "Intro", isViewDidLoad: true)
    }
    
    
    var style : UIStatusBarStyle = UIStatusBarStyle.default;
    

    @objc
    override func viewDidAppear(_ animated: Bool) {
        let intro = Intro()
        self.navigationController?.pushViewController(intro, animated:false)

    }
    

Obj C code:

#import "BaseViewController.h"

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface Intro : BaseViewController

@end

NS_ASSUME_NONNULL_END

Bridging header:

#ifndef ObjectiveCBridgingHeader_h
#define ObjectiveCBridgingHeader_h

#import "Base/Util/ClsUtil.h"
#import "Base/ViewController/BaseViewController.h"
#import "Intro/Intro.h"

#endif /* ObjectiveCBridgingHeader_h */

builds fine and accesses ClsUtil fine without the code involving intro, so I assume that the bridging header is set up correctly in project settings

ps - forgive the noobness. 4th day of iOS. Prior developer left and we don't have a developer to take care of iOS related issues or finish porting the prior app. I wanted to switch to using swift instead of obj c cause it looks cleaner/will give access to the latest tools.

1 Answer 1

1

figured it out. It's because when I copy over folders from OS X finder, the files are not added to the "Compile Sources" section of the Build Phases Tab of the project settings.

I'm still a little confused as to what the proper method of importing folders from another project is. I assume I need to use an Xcode command of some kind instead of OS X finder

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.