I am having a really hard time moving to objective-c /cocoa in terms of the .h and .m files.
I understand what they are, but I don't get what goes where.
My biggest issues right now is
how can I internalize variables for use inside a specific function
if i try to build and go on this i get the error
"var1 undeclared (first use in this function)"
and so on for each variable.
I ONLY want to use those vars inside of that exact function, I don't want them to be accessed anywhere else. Why do I have to declare it somewhere? Or how do i declare it so that is it only used inside that function?
Thanks in advance,
Chris
I understand what they are, but I don't get what goes where.
My biggest issues right now is
how can I internalize variables for use inside a specific function
PHP:
-(void)afunctionImade{
var1 = 1;
var2 = 5;
var3 = var1 + var2;
return var3;
}
if i try to build and go on this i get the error
"var1 undeclared (first use in this function)"
and so on for each variable.
I ONLY want to use those vars inside of that exact function, I don't want them to be accessed anywhere else. Why do I have to declare it somewhere? Or how do i declare it so that is it only used inside that function?
Thanks in advance,
Chris