| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: May 15, 2009
Posts: 1
![]() |
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 PHP Code:
"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 |
| QUOTE Thanks | |
![]() Member Since: Mar 09, 2004
Location: Munich
Posts: 9,075
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
|
It doesn't look as though you've defined an object type for your variables...
You'd need to write: Code:
int var1 = 1; Once declared, you can access the variable directly: Code:
var1 = 5*12; |
| QUOTE Thanks | |
![]() Member Since: Mar 15, 2007
Posts: 161
![]() Mac Specs: 17" MacBook Pro, 2.33GHz C2D, 2GB RAM
|
|
||||
| QUOTE Thanks | |||||
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Best programming language for Mac | knightjp | OS X - Development and Darwin | 21 | 05-10-2010 04:45 PM |
| Objective C call main method | ncohen | OS X - Development and Darwin | 1 | 06-23-2009 03:02 PM |
| New to Objective C - what is the problem with this? | rb1383 | OS X - Development and Darwin | 1 | 04-22-2009 12:33 AM |
| question about objective C memory allocation | thuffir | OS X - Development and Darwin | 3 | 11-18-2008 10:30 PM |
| Cocoa, Objective C - where do I start? | TheMonkey | OS X - Development and Darwin | 1 | 08-19-2006 07:25 AM |
All times are GMT -4. The time now is 11:05 AM.
Powered by vBulletin