Why does the xcode IDE think `friend` is a reserved-word

和自甴很熟 提交于 2019-12-20 04:10:30

问题


I've been working on a personal project and have the below code in a new class that I have created:

@property (readonly, getter = isFriend) BOOL friend;

There doesn't seem to be anything wrong with it and when I build it, it works compiles absolutely fine but when we look at this line of code in the xcode IDE it looks like

My question is why does the xcode IDE seem to think that the word friend is a keyword/reserved-word?


回答1:


Presumably because friend is a reserved word in C++. See Friendship and inheritance.

You could try modifying your xCode settings for the compiler to see if the IDE picks this up. See Can I use C++11 with Xcode?



来源:https://stackoverflow.com/questions/22362912/why-does-the-xcode-ide-think-friend-is-a-reserved-word

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!