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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:49:38+00:00 2026-06-06T10:49:38+00:00

I know that this is a newbie question but I am a newbie so

  • 0

I know that this is a newbie question but I am a newbie so here goes:

I wish to use Chalkduster font quite a lot throughout my app (buttons, labels etc) and have tried subclassing UILabel to achieve this. I have the following in Default.h:

#import <UIKit/UIKit.h>

@interface Default : UILabel
{
UILabel *theLabel;
}

@property (nonatomic, strong) IBOutlet UILabel *theLabel;

@end

and this in my .m:

#import "Default.h"

@implementation Default

- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
    // Initialization code


UIFont *custom = [[UIFont alloc] init];

custom = [UIFont fontWithName:@"Chalkduster" size:18];

self.font = custom;


NSLog(@"h");
}
return self;
}

@end

When I change the class in interface builder and run, I’m not seeing the Chalkduster font. I’d appreciate a hand in getting this set up as I believe it will save me a lot of time.
Cheers.

  • 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-06T10:49:39+00:00Added an answer on June 6, 2026 at 10:49 am

    Some problems to fix:

    1) You’re mixing up the idea of Default being a label and Default containing a label. To subclass, get rid of the property inside your class and make your changes to self rather than theLabel (inside the if (self) { section).

    2) Anything you code after an unconditional return isn’t going to get executed…and I’m surprised the compiler didn’t complain about those statements.

    Edit: …and one more thing that just dawned on me.

    3) If you’re loading from a xib or storyboard, the initialization is done by initWithCoder: instead of initWithFrame:, so:

    - (id)initWithCoder:(NSCoder *)coder {
        self = [super initWithCoder:coder];
        if (self) {
            self.font = [UIFont fontWithName:@"Chalkduster" size:18];
        }
        return self;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this sort of question has been asked here before, but still
I know this may be a very newbie question, but I'd like to use
This is a brain-dead newbie question, but here goes: What determines what files get
I think that this is a newbie type question but I have quite understood
I know that this has already been asked here but the answer (using a
I know that this question is asked a lot, I checked all of the
I know this probably must be a newbie question, but since I don't know
I know that it's a newbie question, but if you could give me a
I know this is a very newbie C# question but I am implementing a
I know this may be an ultra-newbie question, but - although I've been coding

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.