toto_tata
toto_tata

Reputation: 15402

Cocoa Mac OSX: no errors in Debug mode but lot of errors in Release mode...Help !

My OSX program works perfectly well in debug mode. I wanted to "compile and archive" it for release but I have got plenty of errors which appear just in this mode.

For example :

NSButton *showMenuButton =  [[NSButton alloc] initWithFrame:CGRectMake(10,10,10,10)];

gives :

error: incompatible type for argument 1 of 'initWithFrame:'

Most of my erros are linked to initWithFrame method for different classes (NSView, NSImageView...)

Do you know what can be the origin of this issue ?

Thanks a lot !!

Upvotes: 0

Views: 298

Answers (2)

Mahesh
Mahesh

Reputation: 34625

For some issues of this kind in CorePlot, a ticket is opened. It is however marked as fixed with this modification but how ever I didn't find a permanent solution.

Change CGRectMake to NSMakeRect according to this CorePlot Issue Post. Hope it helps :)

Upvotes: 2

Peter Hosey
Peter Hosey

Reputation: 96353

Make sure that you are importing the CoreGraphics header everywhere you need it.

If you are importing it in your prefix header (as I recommend you do with all the system framework headers you import), make sure that that build setting is set, and set to the correct file, in both of your configurations in the project or target where you set it.

Examples of how you might have that wrong:

  • You have the prefix header set in the target, but only in Debug, so in Release, it inherits the (wrong) value from the project.
  • You have it set in the target in both configurations, but to different values.
  • You have it set in the project, but only in Debug, so in Release, it uses the (incorrect) default value.
  • You have it set in the project in both configurations, but to different values.

Upvotes: 0

Related Questions