"Local Declaration of XYZ hides instance variable" means that you have an instance variable called getText declared in your .h file, and you declared an local variable (a variable declared inside a method) with the same name.
Either change the name of the local variable, or don't declare the local variable at all if you don't need it. You probably have the same problem with allText too - you should not declare it inside the method if you need to access it from the whole object.
Either change the name of the local variable, or don't declare the local variable at all if you don't need it. You probably have the same problem with allText too - you should not declare it inside the method if you need to access it from the whole object.
本文探讨了在Objective-C编程中遇到的问题:如何处理局部变量与类实例变量同名的情况。提供了两种解决方案:修改局部变量名称或避免在方法内重复声明该变量。

被折叠的 条评论
为什么被折叠?



