- (NSString *)localizedStringForKey:(NSString *)key
value:(NSString *)value
table:(NSString *)tableName
Doc says about the tableName argument in the above method as: The receiver’s string table to search. If tableName is nil or is an empty string, the method attempts to use the table in Localizable.strings…
My question is if we create a Localizable.strings it creates a string file alone. No tables are created in our project. Where is the table actually? Is it possible to create such string tables manually? I have a need to do that in my project…
And my final question is – What value I have pass as the argument to the tableName parameter?
Thank you…
In that context, “table” refers to the file of translations. So for Localizable.strings, you can get translations from it with NSLocalizedStringFromTable(@”foo”, @”Localizable”, @”comment”). Localizable.strings is the default, however, so you’d typically just use NSLocalizedString(@”foo”, @”comment”). If you add a new translation file (say, Settings.strings), then you’d have use the table name to refer to it.