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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:25:01+00:00 2026-05-23T18:25:01+00:00

My class is like: – (id)init { NSLog(@lalallalalala); if (self = [super init]) {

  • 0

My class is like:

- (id)init
{
NSLog(@"lalallalalala");
if (self = [super init]) {
    self.title = @"lalal";

    UIImage* image = [UIImage imageNamed:@"tab.png"];
    self.tabBarItem = [[[UITabBarItem alloc] initWithTitle:self.title image:image tag:0] autorelease];
    self.variableHeightRows = YES;
    id<TTTableViewDataSource> ds = [MainPageDataSource dataSourceWithItems:nil];
    ds.model = CreateTabModelWithCurrentSettings();
    self.dataSource = ds;

}
return self;
}




- (void)loadView
{
// Create the tableview.

NSLog(@"in MainPageController");

//self.view = [[[UIView alloc] initWithFrame:TTApplicationFrame()] autorelease];
self.view  =[[UIView alloc] init];
self.tableView = [[[UITableView alloc] initWithFrame:TTApplicationFrame() style:UITableViewStylePlain] autorelease];

self.tableView.rowHeight = 80.f;
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:self.tableView];


}



- (id<UITableViewDelegate>)createDelegate {
   return [[[TTTableViewDragRefreshDelegate alloc] initWithController:self] autorelease];
}

CreateDelegate seems not work, no drag & refresh appears. I don’t know what’s wrong with my code.

@aporat the view controller does extend TTTableViewController and my code changed to:

- (id)init
{
NSLog(@"lalallalalala");
if (self = [super init]) {
    self.title = @"app";

    UIImage* image = [UIImage imageNamed:@"tab.png"];
    self.tabBarItem = [[[UITabBarItem alloc] initWithTitle:self.title image:image tag:0] autorelease];
    self.variableHeightRows = YES;
    //id<TTTableViewDataSource> ds = [MainPageDataSource dataSourceWithItems:nil];
    //        ds.model = CreateTabModelWithCurrentSettings();
    //      self.dataSource = ds;
    //self.dataSource = [[[MainPageDataSource alloc] init] autorelease];

}
return self;
}


- (void)createModel {
NSLog(@"in createModel");
self.dataSource = [[[MainPageDataSource alloc] init] autorelease];
}

//- (void)loadView
//{
//    // Create the tableview.
//  
//  NSLog(@"in MainPageController");
//  
//    self.view = [[[UIView alloc] initWithFrame:TTApplicationFrame()] autorelease];
//  //self.view  =[[UIView alloc] init];
//    self.tableView = [[[UITableView alloc] initWithFrame:TTApplicationFrame()  style:UITableViewStylePlain] autorelease];
//  self.toolbarItems = [NSArray arrayWithObjects:
//                       [TTButton buttonWithStyle:@"toolbarButton:" title:@"Toolbar Button"],
//                       [TTButton    buttonWithStyle:@"toolbarRoundButton:" title:@"Round Button"],
//                       nil]; 
//  
//    self.tableView.rowHeight = 80.f;
//    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
//    [self.view addSubview:self.tableView];
//  
//
//}
//- (void)viewDidLoad {
//  [super viewDidLoad];
//  
//  self.navigationController.navigationBar.alpha = 0;
//}


- (id<UITableViewDelegate>)createDelegate {
return [[[TTTableViewDragRefreshDelegate alloc] initWithController:self] autorelease];
}

Still not appears drag & fresh

  • 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-23T18:25:01+00:00Added an answer on May 23, 2026 at 6:25 pm

    There are a few issues with your code:

    • Your view controller has to extend TTTableViewController
    • Don’t override self.view & self.tableView in loadView. The TTTableViewController load these views for you.
    • Create your datasource using the standard method. This function is called automatically if you’re using TTTableViewController:

      ///////////////////////////////////////////////////////////////////////////////////////////////////
      - (void)createModel {
          self.dataSource = [[[CurrencyDataSource alloc] init] autorelease];
       }
      

    What happens if you call this function directly? (This should manually display the drag to refresh header)

    ///////////////////////////////////////////////////////////////////////////////////////////////////
    - (void)reload {
    
      if ([self.tableView.delegate isKindOfClass:[TTTableViewDragRefreshDelegate class]]) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:ttkDefaultFastTransitionDuration];
        self.tableView.contentOffset = CGPointMake(0, -60.0f);
        [UIView commitAnimations];
      }
    
      [super reload];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a class like this: [XmlRoot(channel)] public class Channel { [XmlElement(title)] public String
I have a class like the following: class User: def __init__(self): self.data = []
If I create a class like so: // B.h #ifndef _B_H_ #define _B_H_ class
I have a class like the following: public class DropDownControl<T, Key, Value> : BaseControl
I have a class like this: public class Stretcher : Panel { public static
I have a class like so: public class ClassA { public bool MethodA() {
I have a template class like below. template<int S> class A { private: char
I have a class like this: public class myClass { public List<myOtherClass> anewlist =
Consider a template class like: template<typename ReturnType, ReturnType Fn()> class Proxy { void run()
Given a class like this: class Foo { public: Foo(int); Foo(const Foo&); Foo& operator=(int);

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.