I've been using Objective-C for a while now, but have never really understood what the purpose of the @ symbol before all strings is. For instance, why do you have to declare a string like this:
NSString *string = @"This is a string";
and not like this:
NSString *anotherString = "This is another string";
as you do in Java or so many other programming languages. Is there a good reason?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…