Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 457093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:32:10+00:00 2026-05-12T22:32:10+00:00

Starting with an app already in development, I have carried out the instructions in

  • 0

Starting with an app already in development, I have carried out the instructions in the iPhone Development Guide – Unit Testing Applications

I can successfully include and use my App’s classes in Application-style tests that run on the device, and output their results to the console.

If I add the following line of code:

STAssertTrue([viewController isKindOfClass:[LoginViewController class]], @"Top view controller is not LoginViewController");

The following build error is generated:

Undefined symbols:
  "_OBJC_CLASS_$_LoginViewController", referenced from:
      __objc_classrefs__DATA@0 in LoginViewTest.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

I can provide more configuration information for the project and the Testing target, but the setup works file without the [LoginViewController class] line in the test source.

Without that line, I can reference the class, use it’s properties and send it messages successfully.

Is there a linking build setting, or bundle loading option that is required when attempting to use an App class in this fashion? Or should I find another type of test to confirm that the class of an object is the expected one?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:32:11+00:00Added an answer on May 12, 2026 at 10:32 pm

    I have found an answer, but I think there must be a “better” way?

    In the build configuration for the Unit Tests bundle, you can specify the Bundle Loader (BUNDLE_LOADER) setting that points to your “host” App.

    ${TARGET_BUILD_DIR}/AppName.app/AppName
    

    The Unit Tests bundle is being built as a dependency of your App’s unit testing target (say, AppName Testing), and as a result I haven’t been able to resolve the App executable any better than the above.

    The net result is a working unit test injected into the Testing target without any linker errors. The tests run and access the classes as expected.

    EDIT: Bundle Loader – Target Configuration

    It’s important to configure the target that is “hosting” the testing bundle to not hide it’s symbols.

    GCC_SYMBOLS_PRIVATE_EXTERN = NO
    

    a.k.a. “Symbols hidden by default”. From the documentation:

    When enabled, all symbols are declared
    'private extern' unless explicitly
    marked to be exported using
    '__attribute__((visibility("default")))' in code. If not enabled, all symbols
    are exported unless explicitly marked
    as 'private extern'.

    For more information, see
    http://developer.apple.com/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am starting iPhone Development, I have already made 1 app with c and
Since starting with iPhone app development (last 9 months) I have only used IB.
Possible Duplicate: Starting iPhone app development in Linux? Is there a way to use
I just starting as an Android app developer and I already have a problem
We have a 'small scale' web app. Actually just starting up. For devs already
I have an issue with my app when starting an SimpleBaseGameActivity from another SimpleBaseGameActivity
We have a launcher app that does some setup (starting a server), launches a
Seem to have a problem starting my Java app: Exception in thread main java.lang.NoClassDefFoundError:
I'm new to iPhone development, I bought the certificate a while back and have
I am just starting out with Windows 8 development using HTML/JS. I've spent the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.