Unused variable "a"

+4 Mohammed Ahmed · January 14, 2016
Every time I try to write int a = some number; Xcode shows me unused variable!! how can I fix the problem? I am using Xcode 7.2. Thanks.

Post a Reply


Oldest  Newest  Rating
+2 Laura Lee · January 17, 2016
Use the variable?
Why do you declare a and assign a value to it, if you never use it?
0 Mani Sandhu · January 18, 2016
where are you declaring it? 
+1 Kolten Sturgill · January 18, 2016
Xcode just likes to let you know that you haven't used that variable, doesn't mean there is anything wrong, but Laura is right.
0 Laquin Laquih · January 20, 2016
It's not an error, it's a warning. It sais that because it's illogical to declare a variable if you don't use it, since it's a waste of RAM. Anyway, you can compile the code, so no problem
  • 1



Used in many types of software including music players, video games, and many large scale applications.

Bucky Roberts Administrator