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

  • Home
  • SEARCH
  • 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 6934757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:00:08+00:00 2026-05-27T12:00:08+00:00

I am trying to access the properties and objects that are declared in one

  • 0

I am trying to access the properties and objects that are declared in one view controller in to the page where I need them.Did so by subclassing the view controller.But I have got a problem here,the inherited controller is making the controller overwritten.I mean the navigation bar and header view of the subclassed controller is getting displayed in the used view.When I remove the [super viewDidLoad] method,the vlaues which needs to be displayed is not getting displayed.Also the header view of the inherited view controller is getting displayed.I did subclassing using the following statement:I am also posting the code:

ERViewEditController class:

    @interface ERViewEditController:ERAddReminderController
    {

        UITableView *theTable;

    }

    @property(nonatomic,retain) IBOutlet UITableView *theTable;

    @end

    @implementation ERViewEditController

    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
     - (void)viewDidLoad
     {
         self.view.backgroundColor = [[UIColor alloc]initWithPatternImage:[UIImage imageNamed:@"bg.jpg"]];
         self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(pop:)];
         self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"Edit" style:UIBarButtonItemStylePlain target:self action:@selector(edit:)];

         [self setTitle:@"Reminders Listed"];

         [self.theTable reloadData];
         [super viewDidLoad];
     }

    - (UITableViewCell *)tableView:(UITableView *)view cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {

        NSString *CellId = [NSString stringWithFormat:@"S%1dR%1d",indexPath.section,indexPath.row];

        UITableViewCell *cell = (UITableViewCell *)[view dequeueReusableCellWithIdentifier:CellId];

        UILabel *label1 = [[[UILabel alloc]initWithFrame:CGRectMake(54, 3, 100, 40)]autorelease];
        label1.backgroundColor = [UIColor clearColor];
        label1.textColor = [UIColor whiteColor];

        UILabel *label2 = [[[UILabel alloc]initWithFrame:CGRectMake(119, 3, 100, 40)]autorelease];
        label2.backgroundColor = [UIColor clearColor];
        label2.textColor = [UIColor whiteColor];

        UILabel *label3 = [[[UILabel alloc]initWithFrame:CGRectMake(198, 3, 100, 40)]autorelease];
        label3.backgroundColor = [UIColor clearColor];
        label3.textColor = [UIColor whiteColor];

        if (cell == nil)
        {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellId] autorelease];
            view.backgroundColor = [UIColor clearColor];
            cell.backgroundColor = [[UIColor alloc]initWithPatternImage:[UIImage imageNamed:@"reminderbutton.png"]];

            if (indexPath.section == 0) 
            {
                UILabel *label = [[[UILabel alloc]initWithFrame:CGRectMake(20, 3, 280, 40)]autorelease];
                label.backgroundColor = [UIColor clearColor];
                label.text = @" ID   Name     Event          Date";
                label.textColor = [UIColor cyanColor];
                [cell addSubview:label];
            }   

            else if (indexPath.section == 1)
            {
                const char *dbpath = [databasePath UTF8String];
                sqlite3_stmt *statement;

                if (sqlite3_open(dbpath, &remindersDB) == SQLITE_OK)
                {
                    NSString *querySQL = [NSString stringWithFormat:@"SELECT name,event,date FROM reminders"];

                    const char *query_stmt = [querySQL UTF8String];

                    if (sqlite3_prepare_v2(remindersDB ,query_stmt , -1, &statement, NULL) == SQLITE_OK)
                    {
                        if (sqlite3_step(statement) == SQLITE_ROW)
                        {
                            NSString *nameField = [[NSString alloc] initWithUTF8String:(const char *) sqlite3_column_text(statement, 0)];

                            NSString *eventField = [[NSString alloc]initWithUTF8String:(const char *) sqlite3_column_text(statement, 1)];                    

                            NSString *dateField = [[NSString alloc]initWithUTF8String:(const char *) sqlite3_column_text(statement, 2)];

                            [nameField stringByAppendingString:eventField];

                            label1.text = nameField;
                            label2.text = eventField;
                            label3.text = dateField;
                        } 

                        sqlite3_finalize(statement);
                    }
                    sqlite3_close(remindersDB);
                }

                switch (indexPath.row) 
                {
                    case 0:
                        [cell addSubview:label1];
                        [cell addSubview:label2];
                        [cell addSubview:label3];
                        break;

                    default:
                        break;
                }

            }

        }

        return cell;

    }


My navigation bar issue is resolved,now I have still been facing the header view title issue,I used the following code to fix:

-(NSString *)tableView:(UITableView *)atableView titleForHeaderInSection:(NSInteger)section
{
    return @"";
}

but not working,please help me to get out of this,thanks Mr.Ben for the answer 🙂

Also I have another problem,please check that too if possible,thanks in advance 🙂

Populate the table view sections with rows of table in sqlite database in an order

  • 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-27T12:00:09+00:00Added an answer on May 27, 2026 at 12:00 pm

    Your description is a bit confusing, but it sounds like your superclass is setting a title/button information after you set it in the subclass. Re-order your viewDidLoad so the [super viewDidLoad]; is first in the function, any subclass changes will then be applied after the superclass sets it.

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

Sidebar

Related Questions

Ok, so I'm trying to make a nice superclass for data-access objects that can
I am trying to access a view inside a splitter from my mainframe. At
I have a simple view in which I am trying to access the Model
I'm trying to write a simple component that will allow you to embed one
I'm trying to access an OleVariant in a callback that is coming from an
Im trying to access a web service from a remote computer. I managed to
Im trying to access the Magento customer session in another part of my website.
Im trying to access a Sql CE 2005 database on a windows mobile device
I am trying to access Outlook 2007 from C#. I have installed the PIA
I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing

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.