Your first line should be
NSURL * url = [NSURL URLWithString:@"http://192.168.100.161/UploadWhiteB/wh.txt"];
( NSURLNot a string, but can be easily built from one.)
I expect you to get a compiler warning in your first line - ignoring compiler warnings is bad. The second line fails because it dataWithContentsOfURL:expects there will be a pointer to an object NSURL, and while you pass it the pointer that you typed NSURL*, urlit actually points to the object NSString.