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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:47:18+00:00 2026-05-25T11:47:18+00:00

I have the following code but can’t compile it because I have a Type

  • 0

I have the following code but can’t compile it because I have a “Type name requires a specifier or qualifier” error” for (self).

How to fix this error? I have compared it with the original code and there are no differences, so I don’t know what’s going on.

#import "CurrentTimeViewController.h"


@implementation CurrentTimeViewController

{
    // Call the superclass's designated initializer
    self = [super initWithNibName:@"CurrentTimeViewController" 
                       bundle:nil];

    if (self) {
        // Get the tab bar item
        UITabBarItem *tbi = [self tabBarItem];

        // Give it a label
        [tbi setTitle:@"Time"];
    }
    return self;
}

Here is the code from the mirror file HynososViewController.h, and which I cut, pasted and modified:

#import "HypnososViewController.h"


@implementation HypnososViewController

- (id) init
{
    // Call the superclass's designated initializer
    self = [super initWithNibName:nil 
                       bundle:nil];

    if (self) {
        // Get the tab bar item
        UITabBarItem *tbi = [self tabBarItem];

        // Give it a label
        [tbi setTitle:@"Hypnosis"];
    }
    return self;
}

- (id) initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle
{
    // Disregard parameters - nib name is an implementation detail
   return [self init];
}

// This method gets called automatically when the view is created
- (void)viewDidLoad
{
    [super viewDidLoad];

    NSLog(@"Loaded the view for HypnosisViewController");

    // Set the background color of the view so we can see it
    [[self view] setBackgroundColor:[UIColor orangeColor]];
}
@end

Here is the complete code for CurrentTimeViewController.h:

#import "CurrentTimeViewController.h"


@implementation CurrentTimeViewController

{
    // Call the superclass's designated initializer
    self = [super initWithNibName:@"CurrentTimeViewController" 
                       bundle:nil];

    if (self) {
         // Get the tab bar item
         UITabBarItem *tbi = [self tabBarItem];

         // Give it a label
         [tbi setTitle:@"Time"];
    }
    return self;
}

- (id) initWithNibName:(NSString *)nibName bundle:(NSBundle *)Bundle
{
     // Disregard parameters - nib name is an implementation detail
     return [self init];
}

 // This method gets called automatically when the view is created
- (void)viewDidLoad
{
    [super viewDidLoad];

    NSLog(@"Loaded the view for CurrentTimeViewController");

    // Set the background color of the view so we can see it
    [[self view] setBackgroundColor:[UIColor greenColor]];
}



@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-05-25T11:47:18+00:00Added an answer on May 25, 2026 at 11:47 am

    Is the code above a cut-and-paste of EXACTLY what you are trying to compile? If so, I think you are missing something very important that would make that code block a method implementation:

    -(id)init // This, or something like it, is missing???
    {
        ...
    }
    

    Check your code, here, and in your project. 🙂

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

Sidebar

Related Questions

I have the following code, but can't get it to display the name at
I have the following code to do this, but how can I do it
I have the following code I want to run, but the problem is $this->type
I have the following code but doesnt work [self performSelector:@selector([A1 setImage:[UIImage imageNamed:@m1.10002.png] forState:UIControlStateNormal]) withObject:A1
I have the following code but the clear timeout doesn't work and I can't
I have the following code but can't render color as expected. When I render
I have the following code which is working fine , but can anybody tell
I have the following code but the lon/lat seems to be returning null; package
I have tried the following code but has no effect: Imports system.Runtime.InteropServices <DllImport(UxTheme.DLL, BestFitMapping:=False,
I have the following code and it's working (as usual) in everything but IE.

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.