1

I get Lexical or Preprocessor Issue 'Group.h' file not found which I believe is causing the issues below.

I'm trying to call a method on one of my core data class instances and I get a 'Group' may not respond to '-addPeople:' warning. But I do have an addPeople method in my XCode generated Group class, and here it is:

- (void)addPeople:(NSSet *)value {    
    [self willChangeValueForKey:@"people" withSetMutation:NSKeyValueUnionSetMutation usingObjects:value];
    [[self primitiveValueForKey:@"people"] unionSet:value];
    [self didChangeValueForKey:@"people" withSetMutation:NSKeyValueUnionSetMutation usingObjects:value];
}

I also get the same warning if I try to removePeople. Both of these methods have to do with NSSets but I'm able to call my setters from the Group class just fine.

[selectedObject setTitle:[[titleCell textField] text]]; // works
[selectedObject setSubtitle:[[subTitleCell textField] text]]; // works
NSSet *tempPeople = [NSSet setWithArray:people];
[selectedObject addPeople:tempPeople]; // works, but with warning

Side note

When I type [selectedObject I don't get autocompletion, although the word selectedObject does autocomplete as a Group. So at least that's good.

Group.h

@class People;

@interface Group : NSManagedObject {
@private
}
@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSNumber * order;
@property (nonatomic, retain) NSString * subtitle;
@property (nonatomic, retain) NSSet* people;
@end

Updated

I just finished making a new UITableViewCell class and now instead of it saying Lexical or Preprocessor Issue 'Group.h' file not found it now says Lexical or Preprocessor Issue 'PersonCell.h' file not found

tazboy
  • 1,685
  • 5
  • 23
  • 39

2 Answers2

1

It would be helpful if you were able to post your interface file as well. These are a few reasons I might see for this:

You HAVE a Group.h file, but it does not have a method declaration for these methods. You HAVE a Group.h file, it does have method declarations, but you are not #importing the Group.h into the other class. You do NOT have a Group.h file at all, and are attempting to configure the method and variables as private objects in the implementation file.

Can you post more of your code for us? Possibly the [selectedObject] declaration as well?

xianritchie
  • 331
  • 2
  • 12
  • Well, assuming that you are properly importing Group.h into your other class, AND assuming you have closed XCode completely and the iOS simulator and restarted, I would recommend removing Group.h from your application (but do not delete it), and then re-adding it. – xianritchie Jul 08 '11 at 22:49
  • Take a look at this thread. It has some insightful information as well: http://stackoverflow.com/questions/5584317/compile-build-or-archive-problems-with-xcode-4-and-dependancies?tab=active – xianritchie Jul 09 '11 at 00:26
  • I read that and I couldn't figure out what "user header paths" was or anything else he was talking about. I'm still trying to decipher it. – tazboy Jul 09 '11 at 01:11
0

Lexical or Preprocessor Issue

Well, I couldn't figure out what my problem was so I made a new project and remade each view controller, core data and whatever else I needed. And that solved my problem. I wish I knew what was really causing the Lexical error but from the looks of other people's posts, it could have been a bug.

Group' may not respond to '-addPeople:

This issue was resolved by adding the methods to the .h file. I'm not sure why XCode didn't make those for me, but that solved that problem.

And thanks xianritchie for trying to figure this out with me. It was appreciated.

tazboy
  • 1,685
  • 5
  • 23
  • 39