If you don't expect a value to change you should declare it as a constant. This helps catch mistakes at compile time (e.g. later trying to change this value, which could introduce a bug).
You can declare a string constant with:
NSString *const Foo = @"Foo"; if it's going to be shared across files or
static NSString *const Foo = @"Foo"; if it's only going to be used in a single file, as in this case.
(The static keyword means it is only allocated once and shared across all instances of the class it is declared in.)
It is also common to put all the static string constants at the top of the file, so they are easy to find later. (Since often they are essentially config, so often you are just making a change to the constant value without touching any other code.)
https://github.com/Nagisa-AC/Flixter_4/blob/55b210bc6a267e674b58ec5d2b526b8ea0013a8e/Flixer_4/MovieViewController.m#L96
If you don't expect a value to change you should declare it as a constant. This helps catch mistakes at compile time (e.g. later trying to change this value, which could introduce a bug).
You can declare a string constant with:
NSString *const Foo = @"Foo";
if it's going to be shared across files orstatic NSString *const Foo = @"Foo";
if it's only going to be used in a single file, as in this case.(The
static
keyword means it is only allocated once and shared across all instances of the class it is declared in.)It is also common to put all the static string constants at the top of the file, so they are easy to find later. (Since often they are essentially config, so often you are just making a change to the constant value without touching any other code.)
This isn't a bad longer explanation: https://bytes.vokal.io/objc-string-constants/