user437064
user437064

Reputation:

Error : Duplicate symbol

I declare "int x" in view A and in view B but occur below error Why?

Duplicate symbol -X in...

Upvotes: 0

Views: 285

Answers (1)

hotpaw2
hotpaw2

Reputation: 70743

If you've declared this int variable outside of an interface section, and outside of any method in an implementation section, you've declared a global variable.

A global variables is accessible across an entire app, and can only be declared once (other than as an extern reference) in one place.

If you don't want a global variable, but an object instance variable, declare it inside your interface definition brackets.

Upvotes: 1

Related Questions