You can use regular expression for that:
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression
regularExpressionWithPattern:@"[.]([^.]*)$"
options:NSRegularExpressionCaseInsensitive
error:&error];
NSString *res = [regex stringByReplacingMatchesInString:str
options:0
range:NSMakeRange(0, [str length])
withTemplate:@"STUFF.$1"];
The idea behind the regex is to match the last dot and the extension, and then replace with the additional string of your choice ($1 in the replacement template means the content of the first capturing group, which corresponds to the extension).