I have just begun learning Objective-C, coming from a VB .Net and C# .Net background. I understand pointer usage, but in Objective-C examples I see the asterisk placed in several different places, and search as I might, I have not been able to find an answer as to why this is. Every search I try turns up all kinds of explanations about pointers (which I really don't need), but not a single mention of the reasons/effects of the different placements of the asterisk. Here are some examples I've seen:
NSString *string;
NSString * string;
(NSString *) string;
NSString* string;
What do these different positions of the asterisk mean? I'm sure it's a simple answer but it's frustrating not being able to find it in any of the Apple tutorial and reference documentation or online so far.
Can someone please end my misery and answer this perplexing question? Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…