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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:46:41+00:00 2026-05-25T01:46:41+00:00

I wrote code like: + (CGFloat)tableView:(UITableView*)tableView rowHeightForObject:(id)item { CustomTTTableSubtitleItem* captionedItem = item; CGFloat maxWidth

  • 0

I wrote code like:

+ (CGFloat)tableView:(UITableView*)tableView rowHeightForObject:(id)item {
    CustomTTTableSubtitleItem* captionedItem = item;
    CGFloat maxWidth = tableView.width - kHPadding*2;
    CGSize titleSize = [captionedItem.title sizeWithFont:TTSTYLEVAR(myTitleFont) constrainedToSize:CGSizeMake(maxWidth, CGFLOAT_MAX) lineBreakMode:UILineBreakModeWordWrap];
}

Got this exception:

2011-07-24 03:10:18.762 xinyou[15941:b303] -[TTDefaultStyleSheet
myTitleFont]: unrecognized selector sent to instance 0x5b5e120
2011-07-24 03:10:18.765 xinyou[15941:b303] * Terminating app due to
uncaught exception ‘NSInvalidArgumentException’, reason:
‘-[TTDefaultStyleSheet myTitleFont]: unrecognized selector sent to
instance 0x5b5e120’
*
Call stack at first throw: ( 0 CoreFoundation
0x0119a5a9 exceptionPreprocess + 185 1 libobjc.A.dylib
0x012ee313 objc_exception_throw + 44 2 CoreFoundation
0x0119c0bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 3
CoreFoundation 0x0110b966 __forwarding
+ 966
4 CoreFoundation 0x0110b522
_CF_forwarding_prep_0 + 50 5 xinyou
0x000081f9 +[CustomTTTableSubtitleItemCell
tableView:rowHeightForObject:] + 186 6 xinyou
0x000a6c92 -[TTTableViewVarHeightDelegate
tableView:heightForRowAtIndexPath:] + 156 7 UIKit
0x0064a6d5 -[UISectionRowData

In this exception you can see [TTDefaultStyleSheet myTitleFont]: unrecognized selector sent to instance 0x5b5e120 but actually myTitleFont defined in XYDefaultStyleSheet and I’ve imported XYDefaultStyleSheet.h in my class. XYDefaultStyleSheet.h and XYDefaultStyleSheet.m are like:

XYDefaultStyleSheet.h

#import "Three20/Three20.h"

@interface XYDefaultStyleSheet : TTDefaultStyleSheet

@property(nonatomic,readonly) UIColor* myHeadingColor;
@property(nonatomic,readonly) UIColor* mySubtextColor;
@property(nonatomic,readonly) UIColor* myTitleColor;
@property(nonatomic,readonly) UIFont* myTitleFont;
@property(nonatomic,readonly) UIFont* myHeadingFont;
@property(nonatomic,readonly) UIFont* mySubtextFont;


@end

XYDefaultStyleSheet.m

#import "XYDefaultStyleSheet.h"


///////////////////////////////////////////////////////////////////////////////////////////////////

@implementation XYDefaultStyleSheet


///////////////////////////////////////////////////////////////////////////////////////////////////
// styles

///////////////////////////////////////////////////////////////////////////////////////////////////
// public colors

- (UIColor*)myTitleColor {
    return [UIColor blackColor];
}

- (UIColor*)myHeadingColor {
    return RGBCOLOR(80, 110, 140);
}

- (UIColor*)mySubtextColor {
    return [UIColor grayColor];
}


///////////////////////////////////////////////////////////////////////////////////////////////////
// public fonts

- (UIFont*)myTitleFont {
    return [UIFont boldSystemFontOfSize:16];
}

- (UIFont*)myHeadingFont {
    return [UIFont boldSystemFontOfSize:13];
}

- (UIFont*)mySubtextFont {
    return [UIFont systemFontOfSize:12];
}


@end

why always tell [TTDefaultStyleSheet myTitleFont] … if the problem is really myTitleFont, it should be [XYDefaultStyleSheet myTitleFont], why TTDefaultStyleSheet?

  • 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-25T01:46:41+00:00Added an answer on May 25, 2026 at 1:46 am

    This is an answer to @Jason Zhao’s answer about initialising within the AppDelegate.

    - (void)applicationDidFinishLaunching:(UIApplication *)application {      
        // Override point for customization after app launch   
        [TTStyleSheet setGlobalStyleSheet:[[[CustomDefaultStyleSheet alloc]  
                                            init] autorelease]];  
    
        [window addSubview:[navigationController view]];  
        [window makeKeyAndVisible];  
    }  
    

    Original code is from here, which has a lot of useful information about using TTStyleSheet‘s:

    Three20 Stylesheets iPhone Tutorial

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

Sidebar

Related Questions

I wrote a PHP code like this $site=http://www.google.com; $content = file_get_content($site); echo $content; But
I wrote following code...but i am getting Error like: Error 1 'LoginDLL.Class1.Login(string, string, string)':
i wrote following code to create a linkbutton programmatically, but its showing like lable
i wrote a code like this <?php $extCount = 0; foreach($this->externalReferal as $externalReferal) {
I wrote code like this >>> class a(object): def __init__(self): self.__call__ = lambda x:x
I wrote simple code like public ObservableCollection<string> Names … public Window1() { PutInDataIntoNames(); InitializeComponent();
Im trying to draw a line. I wrote a code like below. UIColor *currentColor
I wrote some test code like this which compiled and worked fine... void threadtest()
I'm not sure if it's possible. I wrote a code like this: listBox1.Items.Add(There are
I wrote some code that looks like this: def get(x, y) @cachedResults.set(x,y, Math.hypot(x, y))

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.