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 9101035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:01:03+00:00 2026-06-17T01:01:03+00:00

Unit testing is handling out humble-pie by the bucketload here at the moment. I

  • 0

Unit testing is handling out humble-pie by the bucketload here at the moment. I am trying to run tests on my BannerAdViewController-class, but everything comes tumbling down when reaching the following line:

UITextView *buyAppTextView  = [[UITextView alloc] initWithFrame:CGRectMake(8, 2, 304, 50)];

The console output is as follows:

-[__NSCFType markupDescription]: unrecognized selector sent to instance 0x1bc2de0

This is the method it reaches before the crash occurs:

-(void)setup{   
    _bannerFrame    = [self frameRectForBannerAd];
    _bannerWrapperFrame = [self frameRectForBannerWrapperFrame];

    UITextView *buyAppTextView  = [[UITextView alloc] initWithFrame:CGRectMake(8, 2, 304, 50)];
    [buyAppTextView setText:@"some text"];
    [buyAppTextView setTextColor:[UIColor blackColor]];
    [buyAppTextView setFont:[UIFont systemFontOfSize:10]];
    [buyAppTextView setAutoresizingMask:UIViewContentModeScaleAspectFit];
    [buyAppTextView setUserInteractionEnabled:NO];  

    _placeHolderBanner  = [[UIView alloc] initWithFrame:_bannerFrame];

    [_placeHolderBanner setBackgroundColor:[UIColor whiteColor]];
    [[_placeHolderBanner layer]  setBorderColor:[UIColor blackColor].CGColor];
    [[_placeHolderBanner layer] setBorderWidth:1.0];
    [_placeHolderBanner addSubview: buyAppTextView];

    [[self view] setFrame:_bannerWrapperFrame];
    [[self view] setBackgroundColor:[UIColor clearColor]];
    [[self view] addSubview: _placeHolderBanner];

    _iAdBanner  = [[ADBannerView alloc] initWithFrame:CGRectZero];

    [[self view] addSubview: _iAdBanner];
    _iAdBanner.delegate = self;
    _iAdBanner.hidden = YES;
}

If I comment out everything to do with the buyAppTextView the tests run fine.
(Yes, the test-rig is linked with UIKit in case you were wondering).

Oh, and the test-class looks like this

#import "NorBannerAdViewTests.h"
#import "NORBannerAdViewController.h"

@implementation NorBannerAdViewTests

NORBannerAdViewController *_adViewController;

- (void)setUp{
    [super setUp];
    _adViewController = [[NORBannerAdViewController alloc] init];
}

- (void)tearDown{
    [super tearDown];
    [_adViewController release];
}

-(void) testThatFrameRectForBannerAdWrapperDoesNotReturnZero{
    CGRect receivedFrame = [_adViewController frameRectForBannerWrapperFrame];
    STAssertFalse((CGRectIsEmpty(receivedFrame)), @"receivedFrame should not be zero");
}

-(void) testThatFrameRectForBannerAdDoesNotReturnZero{
    CGRect receivedFrame = [_adViewController frameRectForBannerAd];    
    STAssertFalse((CGRectIsEmpty(receivedFrame)), @"receivedFrame should not be zero");
}

@end
  • 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-06-17T01:01:05+00:00Added an answer on June 17, 2026 at 1:01 am

    After extensive googling, and tracking through some related threads I (somewhat surprisingly) managed to solve the problem. The problem stems from the fact that the Test target was not setup when creating the project. As it was based on one of the Cocos2D templates I had to add it myself. Doing so, I didn’t hook up the test-target’s build settings with the App.

    I had to add the following two flags to the test-target’s build settings and the tests now run fine:

    Bundle Loader: $(BUILT_PRODUCTS_DIR)/AppName.app/AppName
    Test Host: $(BUNDLE_LOADER)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For unit testing purposes I'm trying to write a mock object of a class
I've started unit testing and I'm trying to perform unit tests on an API
For unit testing you shouldn't test private methods, yes, but for integration tests (using
For unit testing a Scala project, I am writing my own simple javax.sql.DataSource class
I am unit testing an application on the iPhone, and I'm trying to develop
Trying to use nhibernate on sql-server compact edition for unit testing and having some
I am trying to implement some unit tests into a legacy PHP application. There
Should unit testing be run in debug or release mode? I am using Visual
When unit testing class one should test only against public interface of its collaborators.
I have never used Unit Testing and I understand the uses of it but

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.