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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:49:07+00:00 2026-06-04T16:49:07+00:00

I have a workspace that has two projects in it. The first project was

  • 0

I have a workspace that has two projects in it. The first project was essentially a test and develop project where I got things working before worrying about tying everything together for real. The second project is bringing all my individually developed view controllers together in a storyboard.

On one of the view controllers I have a bunch of swipe gestures with quite a bit of UIView animation calls nicely formatted for readability and therefore taking a lot of space. I elected to move them out as a category.

The problem is that the compiler is not seeing the instance variable declarations in the main header file.

What has me pulling my hair out is that I did this in the first project and it all worked fine. So I’m carefully comparing the contents of my second project to the first and I see no differences.

Here’re some file snippets to help demonstrate how/where I’m defining things, and then snippets of code in the category file that is attempting to access them:

GSBViewController.h

@interface GSBViewController : UIViewController

@property (strong, nonatomic) IBOutlet UISegmentedControl *roundPicker;
@property (strong, nonatomic) IBOutlet UIView *roundsSectionView;

GSBViewController.m

#import "GSBViewController+Swipe.h"

@interface GSBGameBuilderViewController ()
{
    UIBarButtonItem *rightGatherBarButton;

    NSInteger previousRound;
}
@end

@implementation GSBViewController
@synthesize roundPicker;
@synthesize roundsSectionView;

GSBViewController+Swipe.h

#import "GSBViewController.h"

@interface GSBViewController (Swipe)

- (void)establishSwipeGestures;

@end

GSBViewController+Swipe.m

#import "GSBViewController+Swipe.h"

@implementation GSBViewController (Swipe)

- (void)establishSwipeGestures
{
    UISwipeGestureRecognizer *swipeLeft = 
       [[UISwipeGestureRecognizer alloc] 
           initWithTarget:self 
                   action:@selector(roundsSectionLeft:)];

    [swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
    [swipeLeft setNumberOfTouchesRequired:1];
    [roundsSectionView addGestureRecognizer:swipeLeft];
// bunch-o-code snipped -- for the time being it's actually all commented out
// as a test and because the LLVM compiler was giving up after too many errors
// and I wanted to see if there was more it would like to tell me about this first --
// and very representative -- problem.
}
@end

The complaint from the compiler is “Use of undeclared identifier ’roundsSectionView'”

If I option-click on the use of roundsSectionView in that line of code where I’m adding the gesture recognizer to it the pop-up correctly describes it as declared in GSBViewController.h

So I’m stumped.

Is there something I can do in Xcode (4.3.2 at the time of this posting 🙂 to let me see what the included files are? Or is there something non-file-based that is needed to tie a category into the class it’s augmenting? I don’t remember anything like that being necessary before. In fact, the way I generated the files for this category was through Xcode’s File -> New File… Objective-C Category template. Then I just copied the contents of the old …+Swipe.h and …+Swipe.m files and pasted them into their respective files in the new project.

  • 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-06-04T16:49:08+00:00Added an answer on June 4, 2026 at 4:49 pm

    What @Jacques Cousteau says is correct.

    Since you just defined a property and no backing ivar, the category won’t be able to access it. If you use self.roundsSectionView it will use the getter method generated for the property and hence it will work.

    Or you could define a backing variable in your interface

    @interface GSBViewController : UIViewController
    {
        UIBarButtonItem *roundsSectionView;
    }
    

    In this case the categories will be able to access the variable. But not any other class.

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

Sidebar

Related Questions

I have a workspace containing 2 projects: A project that has 2 products: a
I have several projects open in an Eclipse workspace. Like so: com.harbl.project.one com.harbl.project.two com.harbl.project.three
I have two build definitions for my project which has two branches. Development and
I have workspace inside of Eclipse which has 2 projects in it. I want
We have a Web Application Project (dozens actually..) that has a testing project attached
I have a current existing project repository that has a lot of code that
I have a java project that has just been imported into TFS and I've
I've got an XCode 4 project that has an additional dependency project in it.
I have a project that has one target dependency. The target dependency is dependent
I have a Maven project that has always worked fine in Netbeans, but upgrading

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.