Placement of the asterisk in Objective-C

前端 未结 14 1123
鱼传尺愫
鱼传尺愫 2020-11-27 13:34

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 s

14条回答
  •  悲哀的现实
    2020-11-27 14:28

    it doesn't matter where you put your asterisk, all statements create pointers of type NSString.

    when using multiple variable names in one line you have to write the asterisk for each variable though.

    NSString * nsstring, * nsstring2;
    

提交回复
热议问题