What do %@ and %ld mean in Objective-C?

| | August 5, 2015

NSString *expectedURL = [NSString stringWithFormat:@"https://%@:%ld/%@"];

What do the %@ and %ld mean?

2 Responses to “What do %@ and %ld mean in Objective-C?”

  1. %@ format specifier used for printing and formatting Objective-c Objects.

    %ld used for Unsigned 64-bit integer .i.e. NSInteger.

  2. They are format specifiers. Basically, insertion points for the rest of the parameters to stringWithFormat.

    https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html

Leave a Reply