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 10-23-2009, 03:30 PM   #1 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 178
dustbyter is on a distinguished road
Default String encoding/replace newline char (0x0A) objc

I'm trying to create a JSON string but my text has new lines in it and this is causing errors.

and example string for what I am trying to create can be seen below.

{"title":" Βιβλίο χωρίς υπόθεση",

"kimeno":"Μια ξανθιά πάει στον πάγκο δανεισμού της Βιβλιοθήκης και λέει:

- Δανείστηκα ένα βιβλίο την προηγούμενη βδομάδα, αλλά ήταν το πιο βαρετό βιβλίο που έχω διαβάσει ποτέ. Δεν είχε καθόλου υπόθεση, αλλά είχε υπερβολικά πολλούς χαρακτήρες.

- Ώστε εσείς λοιπόν μας πήρατε τον τηλεφωνικό κατάλογο!!! ","version":"1.3"}


As you can see above the text has new lines. I tried to replace the new line with <br> but am not having any luck. Any idea on how this can be done in obj-c? I tried to search for the hex characters 0x0A, 0x0D but that didnt work.

Any recommendations?

Thanks.
dustbyter is offline   Reply With Quote
Old 10-25-2009, 03:04 PM   #2 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 178
dustbyter is on a distinguished road
Default

Anyone have any ideas on this one? It has really stumped me.
dustbyter is offline   Reply With Quote
Old 10-25-2009, 05:23 PM   #3 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 178
dustbyter is on a distinguished road
Default

took different approach.

tokenized the string by \n. Then I just appended the string in the format I wanted.
dustbyter 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: 465
12 members and 453 guests
Domele, Duncan C, Feldspar, MacBook MH, Objective Zero, patapple, peterwilli, pipposanta, Punkjumper, SLIC, taylor202, Today's Posts
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,694
Threads: 94,137
Posts: 402,950
Top Poster: BrianSlick (7,990)
Welcome to our newest member, peterwilli
Powered by vBadvanced CMPS v3.1.0

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