1.//stringByAppendingString是在path加后缀的意思
NSString *imagePath = [path stringByAppendingString:[NSString stringWithFormat:@"/%@",imageName]];
2.//stringByAppendingPathComponent是在path后面加上“/”号连接 "字符串" 让它成为完整的路径
stringByAppendingPathComponent是添加/号,使之变成一个完整的路径
NString * str=@“路径”;
str=[stringByAppendingPathComponent:@"img.png"];
打印:str就变成 路径/img.png了
3.//stringByAppendingPathExtension 是加后缀的意思" 自动加上 "." "
如果是stringByAppendingPathExtension是加后缀的意思
NString * str=@“路径”;
str=[str stringByAppendingPathExtension:@"jpg"];
打印:str就变成 路径.jpg