user1930931
user1930931

Reputation: 303

Where do I program a variable in an objective c class so all its methods can use it?

I need to have 5 of my methods use a common variable, but I don't know where to declare it in my .m file. I know this is basic, but I'm quite new and I forgot where to put it. Please help me.

Upvotes: 0

Views: 57

Answers (1)

DrummerB
DrummerB

Reputation: 40211

@implementation {
    // instance variables here  <---
    int foo
    float bar;
}

// methods here

@end

Upvotes: 3

Related Questions