Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Xcode 4.3.1 putting red strikethrough through this protected variable?

Tags:

c++

xcode

enter image description here

Makes total sense that you can't access myPrivateInt. But myProtectedInt is totally accessible here (compiles fine). So why's it got that annoying red strikethrough running through it?

Xcode 4.3.1 using iOS SDK 5.1.

like image 996
Chris Burt-Brown Avatar asked Mar 21 '12 11:03

Chris Burt-Brown


1 Answers

Overriding a protected method in child a class with public access modifier is considered a compromising behavior by XCode. Even though your code is syntactically correct , that strikeout text is a simple warning for you to revise your code to make sure you're not exposing one of your internally important class method to outside world.

Edit: Seems like an Xcode bug.

like image 129
diegoperini Avatar answered Sep 21 '22 08:09

diegoperini