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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-17-2009, 07:32 PM   #1 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
Question Base64 ==> Encode/Decode ?!?!?!

I am getting Base64 encoded text from the server.
I need to decode it
"KG9ic2VydmVyKSBoZWxsbw=="
which should be decoded to
"(observer) hello"

Can somebody tell me how I should decode and encode base64? I searched it on google i found nothing. I don't even need the code. I just need to know the logic, and i'll wirte the code myself.
Is there any library in the sdk that allows me to do this?
aryaxt is offline   Reply With Quote
Old 06-18-2009, 01:12 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

Quote:
Originally Posted by aryaxt View Post
I am getting Base64 encoded text from the server.
I need to decode it
"KG9ic2VydmVyKSBoZWxsbw=="
which should be decoded to
"(observer) hello"

Can somebody tell me how I should decode and encode base64? I searched it on google i found nothing. I don't even need the code. I just need to know the logic, and i'll wirte the code myself.
Is there any library in the sdk that allows me to do this?
There's a category (an extension to a class) for base64 encoding at the bottom of this page:
CocoaDev: BaseSixtyFour

If you use it, you can decode any string with

NSData* mydata = [NSData dataWithBase64EncodedString: yourString];

I've tried it, it works.
__________________

Free Games!
smasher is offline   Reply With Quote
Old 06-19-2009, 10:51 AM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
Default

Thanks a lot, It worked
aryaxt 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
» Stats
Members: 158,307
Threads: 89,033
Posts: 379,817
Top Poster: BrianSlick (7,086)
Welcome to our newest member, percent17
Powered by vBadvanced CMPS v3.1.0

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