objective c - Is it safe to assume that leading underscores are ignored when using the dot syntax -


quick question. of courses teach objective c have participated in prefix instance variables underscore. explain when using dot syntax dont have include leading underscore of instance variables when accessing them. never explicitly said using dot syntax objective c ignore leading underscores, , thats question. dot syntax ignore leading underscores in objective c?

to clear confusion, if have class item , has instance variable called *_itemname, can later (in main) set variable using dot-syntax , ignoring leading underscore item.itemname = something.

i would've thought when first started working on obj-c would've had set _itemname including underscore item._itemname = something.

so case dot syntax ignores leading underscores?

"dot syntax" isn't shortcut accessing instance variables, accessing properties*.

properties might save/load data instance variable, derive data multitude of other variables. they're intended abstraction & layer of indirection.

* technically can use method looks property's method... that's strongly discouraged. don't that!


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -