In our current implementation we want to change our string arguments (Push notification loc-args) and add new arguments. But we want user's of our old Versions to still use argument #3 and for new user's we want to user argument #4. So in our new implementation we have following code :
NSString *format = @"%2$@, %1$@ ,%4$@";
NSArray *arg = @[@"Argument 1", @"Argument 2",@"Argument 3",@"Argument 4"];
NSString *ouptput = [NSString stringWithFormat:format, arg[0], arg[1], arg[2], arg[3]];
OutPut: Argument 2, Argument 1 ,Argument 3
We are expecting it to be
Argument 2, Argument 1 ,Argument 4
How can we achieve Argument 4
in place. Any other alternative of stringWithFormat:
Note: Apple lock screen push notification is correct (Argument 2, Argument 1 ,Argument 4
) but stringWithFormat:
not handles it that way