How to check the NSDATA type?
问题 I have the class which downloads images First I have NSMutable URLRequest than I establish NSURLConnection and than I want to check which data I received in this function - (void)connectionDidFinishLoading:(NSURLConnection *)connection If it is image than write to the folder when it is some text than skip to the next image. How do I check the type of received data? 回答1: In delegate method of NSURLConnection, you can get header of response, from which you can get content type. If content type