Note that there are some explanatory texts on larger screens.

plurals
  1. POCategory header imports not working
    primarykey
    data
    text
    <p>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.</p> <p>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.</p> <p>The problem is that the compiler is not seeing the instance variable declarations in the main header file.</p> <p>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.</p> <p>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:</p> <p>GSBViewController.h</p> <pre><code>@interface GSBViewController : UIViewController @property (strong, nonatomic) IBOutlet UISegmentedControl *roundPicker; @property (strong, nonatomic) IBOutlet UIView *roundsSectionView; </code></pre> <p>GSBViewController.m</p> <pre><code>#import "GSBViewController+Swipe.h" @interface GSBGameBuilderViewController () { UIBarButtonItem *rightGatherBarButton; NSInteger previousRound; } @end @implementation GSBViewController @synthesize roundPicker; @synthesize roundsSectionView; </code></pre> <p>GSBViewController+Swipe.h</p> <pre><code>#import "GSBViewController.h" @interface GSBViewController (Swipe) - (void)establishSwipeGestures; @end </code></pre> <p>GSBViewController+Swipe.m</p> <pre><code>#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 </code></pre> <p>The complaint from the compiler is "Use of undeclared identifier 'roundsSectionView'"</p> <p>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</p> <p>So I'm stumped.</p> <p>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. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload