I would like to define "constant" global variables according to whether the user is on an iPad or an iPhone. For now, I am trying to include this file, globals.h inside my constants.pch file:
// globals.h
// BJ
#ifndef BJ_globals_h
#define BJ_globals_h
float LARGEST_FONT_SIZE = 30.0f;
float LARGE_FONT_SIZE = 20.0f;
float SMALL_FONT_SIZE = 16.0f;
float SMALLEST_FONT_SIZE = 12.0f;
float FONT_SIZE = 18.0f;
float CELL_CONTENT_WIDTH = 320.0f;
float CELL_MIN_HEIGHT = 50.0f;
float CELL_CONTENT_MARGIN = 10.0f;
float MIN_CELL_HEIGHT = .2f;
float SCROLL_VIEW_OFFSET = 0.1f;
float TABLE_VIEW_HEIGHT = 0.45f;
#endif
But when I include this in constants.pch with this call at the top of that file:
// constants.pch
#import "globals.h"
#ifndef BJ_constants_pch
#define BJ_constants_pch
/*
#define LARGEST_FONT_SIZE 30.0f
#define LARGE_FONT_SIZE 20.0f
#define SMALL_FONT_SIZE 16.0f
#define SMALLEST_FONT_SIZE 12.0f
#define FONT_SIZE 18.0f
#define CELL_CONTENT_WIDTH 320.0f
#define CELL_MIN_HEIGHT 50.0f
#define CELL_CONTENT_MARGIN 10.0f
#define MIN_CELL_HEIGHT .2f
#define SCROLL_VIEW_OFFSET 0.1f
#define TABLE_VIEW_HEIGHT 0.45f
*/
...
#endif
I actually get a Mach-O Linker Error:
linker command failed with exit code 1 (use -v to see invocation)
I do not get this error if I try to include globals.h in other files, say in custom classes, but I don't want to have to include it individually in each file. Is there something different I have to do to include this file in constants.pch? Is there another way to easily and conditionally define global variables across the app? I want to set font and cell sizing depending on whether the user is on an iphone or an ipad.
Thank you for any suggestions.
Ps the ultimate goal of this is to conditionally set global variables for font size across the application. So I need a file that can be processed at run time with conditional statements.