Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Loge

macrumors 68030
Original poster
Jun 24, 2004
2,825
1,310
England
When creating a new OS X Objective-C project with Xcode 6 GM (in Mavericks), I am not able to compile the project as soon as I create an action (or outlet) for an interface object. For example if I try to create an action for an NSButton object, I get the error in my controller header file

Parse Issue, Expected a type

at the line

Code:
- (IBAction)calculate:(NSButton *)sender;

No problems at all if I do exactly the same thing in Xcode 5.1.1.

Anyone see this, or know what I might be doing wrong?
 

Loge

macrumors 68030
Original poster
Jun 24, 2004
2,825
1,310
England
Try using Xcode 6.1 Beta 2 from the mac developer page.
Xcode 6.0 is only GM for iOS

Thanks. Same problem happens in the new beta. It seems the required frameworks are missing when creating an Obj-C project instead of Swift.

I can continue in 5.1.1 for now.
 

mwfire

macrumors newbie
Jun 25, 2011
3
12
You have to add
Code:
#import <UIKit/UIKit.h>
manually to the header file whenever it is missing at a view. Seems to be the case with the XCode GM.
 

Loge

macrumors 68030
Original poster
Jun 24, 2004
2,825
1,310
England
This is for an OS X project rather than iOS.

Discovered that in my controller class, I needed to import the Cocoa header,

Code:
#import <Cocoa/Cocoa.h>

instead of the Foundation one that was included in the code generated by Xcode.

Code:
#import <Foundation/Foundation.h>
 

NibsAndXibs

macrumors newbie
Oct 11, 2014
1
0
I think new projects omit the pch in objective c based projects in Xcode 6. So that may be the issue you are having. Adding a pch manually is easy, it's a file template still. Just remember to go to the corresponding targets build settings and fill in the path to the file. Filter by "prefix" in build settings search bar for your target to find the appropriate field. Hope this helps!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.