Reputation: 5698
I try to declare constant to be publicly accessible.
SortType.h
extern NSInteger const ASCENDING;
extern NSInteger const DESCENDING;
SortType.m
NSInteger const ASCENDING = 100;
NSInteger const DESCENDING = 101;
ViewController
#import "SortType.h"
...
SortType.ASCENDING;
But it has following error:
Property 'ASCENDING' not found on object of type 'SortType'
What could be wrong?
Upvotes: 0
Views: 176
Reputation: 107181
The ASCENDING
is not a property of SortType
class, it's a extern constant. So you can't use like:
SortType.ASCENDING;
Just use:
NSInteger myInteger = ASCENDING;
Upvotes: 1