Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-22-2010, 02:36 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 1
kittysniper101 is on a distinguished road
Default NSString and UTF8string problem

Hello everyone.

I have recently begun writing my first application for the iphone (well actually the ipad) and am a little hung up on what seems a very small issue. I have to convert data to unicode to send via an NSOutputStream and when I use the built in NSString method for doing so and send the resulting object I am reading the escaped new line character (\n) in the string that is being sent.
If I remove the \n when I make the NSString it is no longer there but neither is the new line I need.

The relevant code is as follows.

Code:
        
        sendData = [NSString stringWithFormat:@"itemset(\"Bar_01\", \"MAT_COLOR[2]\", %d)\n", b];
	rawString =(const uint8_t *)[sendData UTF8String];
	
	if ([ad.oStream write:rawString maxLength:[sendData length]] < 0) {
thanks for everyone for looking and especially thanks to anyone who solves this.
kittysniper101 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 467
14 members and 453 guests
7twenty7, AlanFloyd, David-T, imac74, Jaxen66, logan, lovoyl, Music Man, mutantskin, Sami Gh, SLIC, solardrift, unicornleo, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,683
Threads: 94,131
Posts: 402,932
Top Poster: BrianSlick (7,990)
Welcome to our newest member, unicornleo
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:09 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0