Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const var NotificationName should not use static #39

Open
KeithMorning opened this issue Dec 18, 2016 · 0 comments
Open

const var NotificationName should not use static #39

KeithMorning opened this issue Dec 18, 2016 · 0 comments

Comments

@KeithMorning
Copy link

In the section of https://github.com/objc-zen/objc-zen-book#constants, we should not use static for NotificationName, or we can' t extern it for other code. For example:

//a.h
extern static NSString *const TestConstNotificationName;
//a.m
static NSString *const TestConstNotificationName = @"TestConstNotificationName";

This won't pass compile.

On other hand, a constant will be init in the global memory area. So it doesn't need a static key word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant