Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
After I defining a Class. You create an instance of that Class which is then called an Object, Instance Object or both?

Trying to get my syntax down so I can communicate better with problems.

-Lars
 
In Objective-C, an Object is, most basically, something you can message.

There are Class objects, every time you write something like [NSArray alloc] you are messaging the Class object.

Class methonds like -alloc or [NSNumber numberWithDouble: 2.0] return instances. And instances respond to instance messages like -objectAtIndex:

You can usually have as many instances as you want, but there is only one Class object for each class.
 
Gotcha, I understand how how it works but I am just failing to use the right terminology (syntax) to describe my problems. in my Class in the @interface I create what are called 'instance variables' and 'method headers'. Then in the @implementation section I define the methods for the @interface section.

Now in 'main', what is the correct way of saying this: "from the Class I create an Object", or "from the Class I create an Instance Object"?

-Lars
 
I'd probably say "Object of class x" or "instance of class x" or even "instance of x". "Instance object" isn't wrong, per se, just a bit verbose.

-Lee
 
"Object" and "Instance" are fully equivalent synonyms. Ulsing them together is merely redundant - sort of like saying "follow the highway road."
 
Thanks. that is what I needed to know the mean the same thing.

thanks!

-Lars
 
Now in 'main', what is the correct way of saying this: "from the Class I create an Object", or "from the Class I create an Instance Object"?

-Lars

"I create an instance of "class"" or "I create a "class" instance" or "I create a "class""

All of them make more sense with an actual class name.

"I create an instance of NSNumber"
"I create a NSString instance"
"I create an NSArray"
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.