Search Results

Search found 477 results on 20 pages for 'nsdata'.

Page 1/20 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Split NSData objects into other NSData objects with a given size

    - by Cedric Vandendriessche
    I'm having an NSData object of approximately 1000kb big. Now I want to transfer this via bluetooth. This would be better if I have let's say 10 objects of 100kb. It comes to mind that I should use the -subdataWithRange: method of NSData. I haven't really worked with NSRange. Well I know how it works, but then to read from a given location with the length: 'to end of file'... I've no idea how to do that. Some code on how to split this into multiple 100kb NSData objects would really help me out here. (it probably involves the length method to see how many objects should be made..?) Thank you in advance.

    Read the article

  • nsdata to nsstring to nsdata

    - by Jayshree
    Hello everybody. I am calling the webservices. The web service returns data in xml format. Now the problem is the xml data is not being received in proper format. In place of "<", "" it returns in html format like-(<) and (>) . So i assigned the xmldata to a NsMutableString and replaced the escape characters so that the format of xml data is proper. Then i reassigned the NSMutableString to NSData so that i can parse the tags. but the problem is the xmlparser stops right where the xml data is. Where i replaced the tags. it doesnt go further. can anybody make me understand what is going on???? This is the xml response from webservice that i called. <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:GetCustomerInfoResponse xmlns:ns1="http://aa.somewebservice.com/phpwebservice"> <return xsi:type="xsd:string"> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;customer&gt;&lt;id&gt;1&lt;/id&gt;&lt;customername&gt;Hitesh&lt;/customername&gt;&lt;phonenumber&gt;98989898&lt;/phonenumber&gt;&lt;/customer&gt; </return> </ns1:GetCustomerInfoResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> And this is after i replaced the tags. <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:GetCustomerInfoResponse xmlns:ns1="http://a.somewebservice.com/phpwebservice"> <return xsi:type="xsd:string"> <?xml version="1.0" encoding="utf-8"?> <customer><id>1</id><customername>Hitesh</customername><phonenumber>98989898</phonenumber></customer> </return> </ns1:GetCustomerInfoResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope> Now the problem is while parsing the parser only goes upto return tag. And then it is stuck there. It doesnt go any further. So wat do i do? anybody care to help me?

    Read the article

  • Encrypt nsdata in iphone and decrypt it in php

    - by Gaurav Arora
    Hi All, I am new to Iphone development , I want to create an application in which I have to upload some data on php server using my Iphone application. For this I have an file on the Iphone whose content I have to upload on php server. For this I have converted the content of the file in NSData and now I want to encrypt this nsdata object and then pass it to the php server and on php server firstly I have to decrypt the nsdata object then I have to upload it on the server. But I am not able to find any way by which I can encrypt some data in Iphone app and then decrypt it in php. And also I want to compress the encrypted data before transferring it to php and then uncompress that data on php. The complete flow of my application is IPhone NSData -- Encrypted NsData -- Compressed Encrypted Data php Compressed Encrypted Data -- uncompressed encrypted data -- decrypted (original) NSData. Can some one help me how can I develop such application? Thanks in advance. Gaurav

    Read the article

  • C-array to NSData and back

    - by Thor Frølich
    I'm attempting to save a c-style array of Vertex3D structs to an NSData object and get them back when reloading the app: NSData *vert = [NSData dataWithBytes:&vertices length:(sizeof(Vertex3D) * NUM_OF_VERTICES)]; This data is then saved and attempted to be read back into my c-array thusly: vertices = malloc(sizeof(Vertex3D) * NUM_OF_VERTICES); [vert getBytes:&vertices length:(sizeof(Vertex3D) * NUM_OF_VERTICES)]; The above results in “EXC_BAD_ACCESS” followed by: malloc: * error for object 0x48423c0: pointer being freed was not allocated I'm very new to programming so there's probably some fundamental memory management principle I'm unaware of. I have verified that the loaded NSData is identical to the saved one, but it's clear that the transition from c-array to NSData (and back) is not as I intended.

    Read the article

  • New NSData with range of old NSData maintaining bytes.

    - by umop
    I have a fairly large NSData (or NSMutableData if necessary) object which I want to take a small chunk out of and leave the rest. Since I'm working with large amounts of NSData bytes, I don't want to make a big copy, but instead just truncate the existing bytes. Basically: NSData *source: < a few bytes I want to discard + < big chunk of bytes I want to keep NSData *destination: < big chunk of bytes I want to keep There are truncation methods in NSMutableData, but they only truncate the end of it, whereas I want to truncate the beginning. My thoughts are to do this with the methods: - getBytes:range: and - initWithBytesNoCopy:length:freeWhenDone: However, I'm trying to figure out how to manage memory with these. I'm guessing the process will be like this (I've placed ????s where I don't know what to do): void *buffer // Get range of bytes [source getBytes:buffer range:NSMakeRange(myStart, myLength)]; // Somehow (m)alloc the memory which will be freed up in the following step ????? // Release the source, now that I've allocated the bytes [source release]; // Create a new data, recycling the bytes so they don't have to be copied NSData destination = [[NSData alloc] initWithBytesNoCopy:buffer length:myLength freeWhenDone:YES]; Thanks for the help!

    Read the article

  • objective-c uncompress/inflate a NSData object which contains a gzipped string

    - by user141146
    Hi, I'm using objective-c (iPhone) to read a sqlite table that contains blob data. The blob data is actually a gzipped string. The blob data is read into memory as an NSData object I then use a method (gzipInflate) which I grabbed from here (http://www.cocoadev.com/index.pl?NSDataCategory) -- see method below. However, the gzipInflate method is returning nil. If I step through the gzipInflate method, I can see that the status returned near the bottom of the method is -3, which I assume is some type of error (Z_STREAM_END = 1 and Z_OK = 0, but I don't know precisely what a status of -3 is). Consequently, the function returns nil even though the input NSData is 841 bytes in length. Any thoughts on what I'm doing wrong? Is there something wrong with the method? Something wrong with how I'm using the method? Any thoughts on how to test this? Thanks for any help! - (NSData *)gzipInflate { // NSData *compressed_data = [self.description dataUsingEncoding: NSUTF16StringEncoding]; NSData *compressed_data = self.description; if ([compressed_data length] == 0) return compressed_data; unsigned full_length = [compressed_data length]; unsigned half_length = [compressed_data length] / 2; NSMutableData *decompressed = [NSMutableData dataWithLength: full_length + half_length]; BOOL done = NO; int status; z_stream strm; strm.next_in = (Bytef *)[compressed_data bytes]; strm.avail_in = [compressed_data length]; strm.total_out = 0; strm.zalloc = Z_NULL; strm.zfree = Z_NULL; if (inflateInit2(&strm, (15+32)) != Z_OK) return nil; while (!done) { // Make sure we have enough room and reset the lengths. if (strm.total_out >= [decompressed length]) [decompressed increaseLengthBy: half_length]; strm.next_out = [decompressed mutableBytes] + strm.total_out; strm.avail_out = [decompressed length] - strm.total_out; // Inflate another chunk. status = inflate (&strm, Z_SYNC_FLUSH); NSLog(@"zstreamend = %d", Z_STREAM_END); if (status == Z_STREAM_END) done = YES; else if (status != Z_OK) break; //status here actually is -3 } if (inflateEnd (&strm) != Z_OK) return nil; // Set real length. if (done) { [decompressed setLength: strm.total_out]; return [NSData dataWithData: decompressed]; } else return nil; }

    Read the article

  • How to serialize object containing NSData?

    - by AO
    I'm trying to serialize an object containing a number of data fields...where one of the fields is of datatype NSData which won't serialize. I've followed instructions at http://www.isolated.se but my code (see below) results in the error "[NSConcreteData data]: unrecognized selector sent to instance...". How do I serialize my object? Header file: @interface Donkey : NSObject<NSCoding> { NSString* s; NSData* d; } @property (nonatomic, retain) NSString* s; @property (nonatomic, retain) NSData* d; - (NSData*) serialize; @end Implementation file: @implementation Donkey @synthesize s, d; static NSString* const KEY_S = @"string"; static NSString* const KEY_D = @"data"; - (void) encodeWithCoder:(NSCoder*)coder { [coder encodeObject:self.s forKey:KEY_S]; [coder encodeObject:self.d forKey:KEY_D]; } - (id) initWithCoder:(NSCoder*)coder; { if(self = [super init]) { self.s = [coder decodeObjectForKey:KEY_STRING]; self.d [coder decodeObjectForKey:KEY_DATA]; } return self; } - (NSData*) serialize { return [NSKeyedArchiver archivedDataWithRootObject:self]; } @end

    Read the article

  • Convert NSData into Hex NSString

    - by Dawson
    With reference to the following question: Convert NSData into HEX NSSString I have solved the problem using the solution provided by Erik Aigner which is: NSData *data = ...; NSUInteger capacity = [data length] * 2; NSMutableString *stringBuffer = [NSMutableString stringWithCapacity:capacity]; const unsigned char *dataBuffer = [data bytes]; NSInteger i; for (i=0; i<[data length]; ++i) { [stringBuffer appendFormat:@"%02X", (NSUInteger)dataBuffer[i]]; } However, there is one small problem in that if there are extra zeros at the back, the string value would be different. For eg. if the hexa data is of a string @"3700000000000000", when converted using a scanner to integer: unsigned result = 0; NSScanner *scanner = [NSScanner scannerWithString:stringBuffer]; [scanner scanHexInt:&result]; NSLog(@"INTEGER: %u",result); The result would be 4294967295, which is incorrect. Shouldn't it be 55 as only the hexa 37 is taken? So how do I get rid of the zeros? EDIT: (In response to CRD) Hi, thanks for clarifying my doubts. So what you're doing is to actually read the 64-bit integer directly from a byte pointer right? However I have another question. How do you actually cast NSData to a byte pointer? To make it easier for you to understand, I'll explain what I did originally. Firstly, what I did was to display the data of the file which I have (data is in hexadecimal) NSData *file = [NSData dataWithContentsOfFile:@"file path here"]; NSLog(@"Patch File: %@",file); Output: Next, what I did was to read and offset the first 8 bytes of the file and convert them into a string. // 0-8 bytes [file seekToFileOffset:0]; NSData *b = [file readDataOfLength:8]; NSUInteger capacity = [b length] * 2; NSMutableString *stringBuffer = [NSMutableString stringWithCapacity:capacity]; const unsigned char *dataBuffer = [b bytes]; NSInteger i; for (i=0; i<[b length]; ++i) { [stringBuffer appendFormat:@"%02X", (NSUInteger)dataBuffer[i]]; } NSLog(@"0-8 bytes HEXADECIMAL: %@",stringBuffer); As you can see, 0x3700000000000000 is the next 8 bytes. The only changes I would have to make to access the next 8 bytes would be to change the value of SeekFileToOffset to 8, so as to access the next 8 bytes of data. All in all, the solution you gave me is useful, however it would not be practical to enter the hexadecimal values manually. If formatting the bytes as a string and then parsing them is not the way to do it, then how do I access the first 8 bytes of the data directly and cast them into a byte pointer?

    Read the article

  • how can I translate a NSString to NSData? And the data has the same content as the string

    - by someonemaybe
    NSString * theString=@"e88d"; NSData * data; // something I should implement NSLog(@"%@", theString); NSLog(@"%@",[data description]); I want the results of the two printings are the same. AES encryption and decryption: (1).The server: if the plaintext is :@"abcd"; the AES encrypted data(NSData data type) is :"d882830c dc892036 4345839f 13c7516a"; (2).in my local app, my code is : NSData*data=[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://..."]]; NSString * mystring= [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; However, to decrypt data successfully, I must got a data(NSData date type) which equals to "d882830c dc892036 4345839f 13c7516a".But it is the mystring (NSString data type) not the data(NSData data type) that equals to the right value. the encryption and decryption function both need a data(NSData data type) as input datas. (NSData*)AES128EncryptWithKey:(NSString*)key; (NSData*)AES128DecryptWithKey:(NSString*)key;

    Read the article

  • NSData-AES Class Encryption/Decryption in Cocoa

    - by David Schiefer
    hi, I am attempting to encrypt/decrypt a plain text file in my text editor. encrypting seems to work fine, but the decrypting does not work, the text comes up encrypted. I am certain i've decrypted the text using the word i encrypted it with - could someone look through the snippet below and help me out? Thanks :) Encrypting: NSAlert *alert = [NSAlert alertWithMessageText:@"Encryption" defaultButton:@"Set" alternateButton:@"Cancel" otherButton:nil informativeTextWithFormat:@"Please enter a password to encrypt your file with:"]; [alert setIcon:[NSImage imageNamed:@"License.png"]]; NSSecureTextField *input = [[NSSecureTextField alloc] initWithFrame:NSMakeRect(0, 0, 300, 24)]; [alert setAccessoryView:input]; NSInteger button = [alert runModal]; if (button == NSAlertDefaultReturn) { [[NSUserDefaults standardUserDefaults] setObject:[input stringValue] forKey:@"password"]; NSData *data; [self setString:[textView textStorage]]; NSMutableDictionary *dict = [NSDictionary dictionaryWithObject:NSPlainTextDocumentType forKey:NSDocumentTypeDocumentAttribute]; [textView breakUndoCoalescing]; data = [[self string] dataFromRange:NSMakeRange(0, [[self string] length]) documentAttributes:dict error:outError]; NSData*encrypt = [data AESEncryptWithPassphrase:[input stringValue]]; [encrypt writeToFile:[absoluteURL path] atomically:YES]; Decrypting: NSAlert *alert = [NSAlert alertWithMessageText:@"Decryption" defaultButton:@"Open" alternateButton:@"Cancel" otherButton:nil informativeTextWithFormat:@"This file has been protected with a password.To view its contents,enter the password below:"]; [alert setIcon:[NSImage imageNamed:@"License.png"]]; NSSecureTextField *input = [[NSSecureTextField alloc] initWithFrame:NSMakeRect(0, 0, 300, 24)]; [alert setAccessoryView:input]; NSInteger button = [alert runModal]; if (button == NSAlertDefaultReturn) { NSLog(@"Entered Password - attempting to decrypt."); NSMutableDictionary *dict = [NSDictionary dictionaryWithObject:NSPlainTextDocumentType forKey:NSDocumentTypeDocumentOption]; NSData*decrypted = [[NSData dataWithContentsOfFile:[self fileName]] AESDecryptWithPassphrase:[input stringValue]]; mString = [[NSAttributedString alloc] initWithData:decrypted options:dict documentAttributes:NULL error:outError];

    Read the article

  • Objective C - Parse NSData

    - by EZFrag
    I have the following data inside an NSData object: <00000000 6f2d840e 31504159 2e535953 2e444446 3031a51b 8801015f 2d02656e 9f110101 bf0c0cc5 0affff3f 00000003 ffff03 I'm having issues parsing this data. This data contains information which is marked by tags Tag 1 is from byte value 0x84 to 0xa5 Tag 2 is from byte value 0xa5 to 0x88 Tag 3 is from byte value 0x88 to 0x5f0x2d Tag 4 is from byte value 0x5f0x2d to 0x9f0x11 How would I go about to get those values from the NSData object? Regards, EZFrag

    Read the article

  • Memory leak with NSData

    - by Kamchatka
    I'm having a leak with this code without being able to find where it's coming from. This function get called within an autorelease pool. I release the IplImage* image argument. When I run the ObjAlloc tool, it tells me that "NSData* data" is leaking. If I try to manually release the UIImage returned by this function, I get an EXC_BAD_ACCESS error, probably because this UIImage is autoreleased. I'm a bit confused, any hint would be appreciated. Thanks! UIImage *UIImageFromIplImage(IplImage *image) { NSLog(@"IplImage (%d, %d) %d bits by %d channels, %d bytes/row %s", image->width, image->height, image->depth, image->nChannels, image->widthStep, image->channelSeq); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); NSData *data = [NSData dataWithBytes:image->imageData length:image->imageSize]; CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)data); CGImageRef imageRef = CGImageCreate(image->width, image->height, image->depth, image->depth * image->nChannels, image->widthStep, colorSpace, kCGImageAlphaNone|kCGBitmapByteOrderDefault, provider, NULL, false, kCGRenderingIntentDefault); UIImage *ret = [UIImage imageWithCGImage:imageRef]; CGImageRelease(imageRef); CGDataProviderRelease(provider); CGColorSpaceRelease(colorSpace); return ret; }

    Read the article

  • Correct way to load image into UIWebView from NSData object

    - by rustyshelf
    I have downloaded a gif image into an NSData object (I've checked the contents of the NSData object and it's definitely populated). Now I want to load that image into my UIWebView. I've tried the following: [webView loadData:imageData MIMEType:@"image/gif" textEncodingName:nil baseURL:nil]; but I get a blank UIWebView. Loading the image from the same URL directly works fine: NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:imageUrl]]; [imageView loadRequest:request]; Do I need to set the textEncodingName to something, or am I doing something else wrong? I want to load the image manually so I can report progress to the user, but it's an animated gif, so when it's done I want to show it in a UIWebView. Edit: Perhaps I need to wrap my image in HTML somehow? Is there a way to do this without having to save it to disk?

    Read the article

  • NSData to display as a string

    - by topace
    Hello all, this is my first post. I am building an iPhone app and stuck with the following: unsigned char hashedChars[32]; CC_SHA256([inputString UTF8String], [inputString lengthOfBytesUsingEncoding:NSASCIIStringEncoding], hashedChars); NSData *hashedData = [NSData dataWithBytes:hashedChars length:32]; NSLog(@"hashedData = %@", hashedData); The log is showing like: hashedData = <abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh> But what I need is to convert hashedData into NSString that looks like: NSString *someString = @"abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh"; So basically the string needs to be like hashedData except I don't want the angle brackets and spaces in between. Any help is much appreciated.

    Read the article

  • NSData's writeToFile method failing with server address

    - by Ricky
    Hi. I am trying to write an NSData object to a directory like so; [myData writeToFile:[NSString stringWithFormat:@"%@/%@.txt", path, filename] atomically:YES]; I receive no errors or warnings but I am assuming the write fails because the path variable has the format of afp://10.0.0.20/username/Desktop. I am connected to the networked share. Do I need to modify the string or take a different approach here? TIA, Ricky.

    Read the article

  • Convert nsdata to nsstring

    - by ashwini
    Hi, I have utf8 encoded nsdata from windows server. I want to convert it to nsstring for iphone. Since data contains characters(like degree symbol) which have different values on both platforms, how do I convert data to string.

    Read the article

  • Turning NSData to NSString is failing

    - by Ricky D'Amelio
    Hi there. I have an NSData object which I am trying to turn into an NSString using the following line of code: NSString *theData = [[NSString alloc] initWithData:photo encoding:NSASCIIStringEncoding]; Unfortunately I am getting the following result, instead of my desired binary output (can I expect a binary output here?); ÿØÿà I'd appreciate any help. Thanks. Ricky.

    Read the article

  • Converting NSData to an NSString representation is failing

    - by Ricky D'Amelio
    Hi there. I have an NSData object which I am trying to turn into an NSString using the following line of code: NSString *theData = [[NSString alloc] initWithData:photo encoding:NSASCIIStringEncoding]; Unfortunately I am getting the following result, instead of my desired binary output (can I expect a binary output here?); ÿØÿà I'd appreciate any help. Thanks. Ricky.

    Read the article

  • NSData dataWithContentsOfURL

    - by ketan rajput
    I have this method for button click (download). The problem is that it is terminating due to an exception: [Session started at 2011-03-14 13:06:45 +0530.] 2011-03-14 13:06:45.710 XML[7079:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString isFileURL]: unrecognized selector sent to instance 0x62b8' -(IBAction) download { UIImage *image = [UIImage imageWithData: [NSData dataWithContentsOfURL:@"http://ws.cdyne.com/WeatherWS/Images/thunderstorms.gif"]]; [image release]; } What is the problem?

    Read the article

  • Trying to resize an NSImage which turns into NSData

    - by Ricky
    I have an NSImage which I am trying to resize like so; NSImage *capturePreviewFill = [[NSImage alloc] initWithData:previewData]; NSSize newSize; newSize.height = 160; newSize.width = 120; [capturePreviewFill setScalesWhenResized:YES]; [capturePreviewFill setSize:newSize]; NSData *resizedPreviewData = [capturePreviewFill TIFFRepresentation]; resizedCaptureImageBitmapRep = [[NSBitmapImageRep alloc] initWithData:resizedPreviewData]; [saveData writeToFile:@"/Users/ricky/Desktop/Photo.jpg" atomically:YES]; My first issue is that my image gets squashed when I try to resize it and don't conform to the aspect ratio. I read that using -setScalesWhenResized would resolve this problem but it didn't. My second issue is that when I try to write the image to a file, the image isn't actually resized at all. Thanks in advance, Ricky.

    Read the article

  • Text encoding problem between NSImage, NSData, and NSXMLDocument

    - by andyvn22
    I'm attempting to take an NSImage and convert it to a string which I can write in an XML document. My current attempt looks something like this: [xmlDocument setCharacterEncoding: @"US-ASCII"]; NSData* data = [image TIFFRepresentation]; NSString* string = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; //Put string inside of NSXMLElement, write out NSXMLDocument. Reading back in looks something like this: NSXMLDocument* newXMLDocument = [[NSXMLDocument alloc] initWithData:data options:0 error:outError]; //Here's where it fails. I get: //Error Domain=NSXMLParserErrorDomain Code=9 UserInfo=0x100195310 "Line 7: Char 0x0 out of allowed range" I assume I'm missing something basic. What's up with this encoding issue?

    Read the article

  • Getting info from NSData object

    - by Moshe
    How would I get returningResponse (into say, a NSString) from the following code: NSURLResponse* response; NSError* error; NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error]; I think I can get the info that I need into a string but I can't call anything on response because it's null. Therefore, I assume that I need to call something on result. The problem is, I don't know what to call. (The URL request has been coded prior to the code sample. I know that that works.) I want to be able to detect if the request as successful.

    Read the article

  • Unicode data from NSData to NSString

    - by Jeff
    So if I have NSData from an HTTP request, then I do something like this: NSString *test = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; This will result in null if the data contains weird unicode data (title is from reddit): {"title":"click..¦¦me..and..then¦¦________ ¦¦check¦¦_.your...¦¦.__...¦¦____ ¦¦....¦¦¦¦¦¦¦¦¦¦¦¦¦¦....¦¦____ ¦¦¦¦¦¦....¦¦¦¦¦¦....¦¦¦¦¦¦____ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦____ ....¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦______ ........¦¦..._recently....¦¦________ ....¦¦....viewed....links....¦¦_____"}, How would I convert the data to a string? Ideally, it would best if the string wasn't null so I could parse it as JSON, but even a lossy conversion is fine with me in these cases. I'm not familiar with unicode (naive American I am), so any enlightenment about that would be a nice bonus :)

    Read the article

  • Downloading image from server without file extension (NSData to UIImage)

    - by Msencenb
    From my server I'm pulling down a url that is supposed to simply be a profile image. The relevant code for pulling down the image from the urls is this: NSString *urlString = [NSString stringWithFormat:@"%@%@",kBaseURL,profile_image_url]; profilePic = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]]]; My url is in the format (note no file extension on the end since its dynamically rendered) localhost:8000/people/1/profile_image If I load the url in my browser the image displays; however the code above for pulling down the UIImage does not work. I've verified that the code does pull an image from a random site on the interwebs. Any thoughts on why this is happening?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >