Reprinted from: http://arc9.riaos.com/?p=4980
CYY: Self-understanding, not guaranteed to be correct, but the actual test is feasible: if the use of stringbyappendingstring you need to manually add "/" symbol before the name, and stringbyappendingpathcomponent do not need, it will be automatically added
The difference between stringbyappendingpathcomponent and stringbyappendingstring:
NSString *imagepath = [Skinpath stringbyappendingstring:[nsstring stringwithformat:@ "/%@", imageName]];// Stringbyappendingstring is the meaning of skinpath plus suffix nsstring *imagepath = [Skinpath stringbyappendingpathcomponent: Imagename];//stringbyappendingpathcomponent is to add "/" to the Skinpath after the imageName to make it a full path NSLog (@ "imagepath:%@", ImagePath);
The difference between stringbyappendingpathcomponent and stringbyappendingstring