syntax - What does the @ symbol mean for Objective-C? -
i know following uses of @ (at symbol):
@"mystring" - used indicate objective-c nsstring, rather standard c string
@keyword - used identify objective c keywords such @implementation, @synthesize, @class , @interface
what @keyname mean in context below?
[sfhfkeychainutils storeusername:@keyname andpassword:[nsstring stringwithutf8string:b64data] forservicename:@"default" updateexisting:yes error:&ter_ror];
does @ have other possible meanings?
it means nothing @ in context of code snippet. fail syntax error.
the reason @ used in obj-c keywords , in constant strings because @ not valid character use part of token in c, , obj-c strict superset of c. means valid c code valid obj-c code, obj-c can't take keywords have possibly shown in valid c. since @ isn't valid in tokens, means obj-c use start of keywords , not worry collisions.
as other possible meanings, there few keywords omitted, such @protocol
, @dynamic
, @private
, @protected
, @public
, @selector
, , @encode
.
Comments
Post a Comment