syntax - Objective-C: Is it bad practice to use dot notation inside of a message? -


i couldn't find similar question decided ask (this may more appropriately asked on programmers, if apologize in advance).

is bad practice use dot notation along message call, so:

[self.view addsubview:otherview]; 

as opposed to:

[[self view] addsubview:otherview]; 

i curious, looked tad bit strange don't see wrong it. i'm still relatively new objective-c , not familiar best practices of note yet.

there's nothing wrong it. it's merely stylistic question. use whichever 1 prefer. (the dot notation, way, has advantage compiler throws error if you're calling undeclared property getter or setter dot notation, can potentially rid of strange run-time errors @ compile time.)


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -