Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Dec 21, 2012, 01:01 PM   #1
Dreamspinner
macrumors member
 
Join Date: Dec 2012
NSString format & xtra characters

I'm trying to send an ASCII string with CRLF appended, to a device via a serial port.

Code:
NSString *sendString = [[inputTextField stringValue] stringByAppendingString:@"\n\r"];

//[inputTextField stringValue] is "AP1090;".	

if([self.port isOpen]) { // in case an error occured while opening the port
  [self.port writeString:sendString usingEncoding:NSUTF8StringEncoding error:NULL];
}
When looking at the value of sendString in the debugger it shows:
Code:
sendString	__NSCFString *	0x0000000101917800@"AP1090;\n\r\x0e\x19\x10"
What are the extra characters "x0e\x19\x10" and are they supposed to be there?

The device is not responding.

Last edited by dejo; Dec 21, 2012 at 01:54 PM. Reason: Please use [code] tags.
Dreamspinner is offline   0 Reply With Quote

 
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Format & Install Clean? MBX MacBook Pro 5 Mar 22, 2014 01:33 PM
Resolved: Sediment? xtra 0x0A after `sed ... < x.bin` zeppenwolf Mac Programming 5 Dec 28, 2013 09:55 PM
Find multiple characters in a NSString fstigre iPhone/iPad Programming 5 Jan 6, 2013 07:59 AM
how to remove &amp; from NSString Narendar Singh iPhone/iPad Programming 7 Dec 12, 2012 09:34 AM
Format & Reinstall OS (LION) playingserious OS X 3 Jul 27, 2012 12:13 PM

Forum Jump

All times are GMT -5. The time now is 07:59 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC