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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T07:01:56+00:00 2026-05-17T07:01:56+00:00

Simple problem… I had some comments on my code and deleted them and got

  • 0

Simple problem… I had some comments on my code and deleted them and got an error. After some hours I arrived at the source.

This code works:

switch (indexPath.row) {
    case 0:
        NSLog(@"case 0");
        break;
    case 1: // Clients
        NSLog(@"case 1");

        ViewClientListTableController *viewListTableController = [[ViewClientListTableController alloc] init];//]WithNibName:@"BrowseViewController" bundle:nil];
        viewListTableController.managedObjectContext = self.managedObjectContext;
        [self.navigationController pushViewController:viewListTableController animated:YES];
        //[self.navigationController setNavigationBarHidden:NO];
        [viewListTableController release];

        break;
}

This next one, (by just removing the NSLog(@”case 1″); ) does NOT work:

switch (indexPath.row) {
    case 0:
        NSLog(@"case 0");
        break;
    case 1: // Clients


        ViewClientListTableController *viewListTableController = [[ViewClientListTableController alloc] init];//]WithNibName:@"BrowseViewController" bundle:nil];
        viewListTableController.managedObjectContext = self.managedObjectContext;
        [self.navigationController pushViewController:viewListTableController animated:YES];
        //[self.navigationController setNavigationBarHidden:NO];
        [viewListTableController release];

        break;
}

As you can see, only the NSLog line is gone. And the compiler is giving me 2 errors:

RootViewController.m:212: error: expected expression before ‘ViewClientListTableController’

RootViewController.m:213: error: ‘viewListTableController’ undeclared (first use in this function)

Of course, one answer is to leave the NSLog line, but really… why is this error happening?

  • 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-17T07:01:57+00:00Added an answer on May 17, 2026 at 7:01 am

    switch statements often have trouble with variables being declared in their case labels. I bet

    {
            ViewClientListTableController *viewListTableController = [[ViewClientListTableController alloc] init];//]WithNibName:@"BrowseViewController" bundle:nil];
            viewListTableController.managedObjectContext = self.managedObjectContext;
            [self.navigationController pushViewController:viewListTableController animated:YES];
            //[self.navigationController setNavigationBarHidden:NO];
            [viewListTableController release];
    }
    

    works in case 1: – the NSLog macro probably has an expansion that has a similar effect.

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

Sidebar

Related Questions

I have a simple problem that I've been stuck on for some time and
Simple problem: With the XML layout shown below, I have some views wrapped in
This may be a simple problem. But im totally stuck with this error. I
Simple problem, how to find the first non-zero digit after decimal point. What I
some simple problem: I've this array; $myArray = array( 'FOO', 'BAR, ); i want
Simple problem, actually. I need an overview of Unicode/HTML Character entity code for all
Quite simple problem (but difficult solution): I got a string in PHP like as
I have a simple problem but I haven't had any luck finding the solution
I've got a simple problem, but somehow fail to solve it properly : I
Simple problem, I copy and pasted the sample code of a Google Maps page

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.