If remove swift file from project it is complied successfully. if add then get error.
Asked
Active
Viewed 129 times
0

Sasha Sewerow
- 117
- 2
- 7
-
Can you share a link to the project to have a look on it? – shallowThought Jun 12 '17 at 12:47
-
https://drive.google.com/open?id=0B2blcQ9XdtsdVzhvMlZCMERKcTA archive with test framework project. Just download and build. – Sasha Sewerow Jun 12 '17 at 18:38
1 Answers
0
#define
s get converted to Swift by trying to figure out the type. For instance
#define B @"b"
...becomes:
var B: String { get }
Find details in this answer.
As your define #define MY_EXPORT
does not provide a type, the conversion fails.
This code would work:
Prefix.pch:
#define MY_EXPORT @"Olala"
MyOneClass.m:
#import "MyOneClass.h"
@implementation MyOneClass
- (void)method {
NSString *useIt = MY_EXPORT;
}
@end

shallowThought
- 19,212
- 9
- 65
- 112
-
The thing is that use this macros as I described in header file?!?! For .m file, you are right, it works. – Sasha Sewerow Jun 13 '17 at 12:05
-