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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-08-2011, 08:25 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 54
warrior is on a distinguished road
Default How to create .CSV file with string and image in iphone programatically?

I want to create a csv file which contains both string and image. I am able to give the input as a strings separated by commas. Ex

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDire ctory , NSUserDomainMask, YES);
NSString *documentsDir = [paths objectAtIndex:0];
NSString *root = [documentsDir stringByAppendingPathComponent:@"products.csv"];
NSString *temp=@"jack,jil,jimmy,mike";
[temp writeToFile:root atomically:YES encoding:NSUTF8StringEncoding error:NULL];

In the above case it works fine. Now i need to add an image with the strings. I have the image as NSData.In this case how can i give the input to csv file.

I am also able to attach the image alone to a csv file as NSData. Ex

UIImage *img = [UIImage imageNamed:@"flower.png"];
NSData *dataObj = UIImageJPEGRepresentation(img, 1.0);
[dataObj writeToFile:root atomically:YES];

My expected output should contain both image and string if i open the csv file as Excel sheet. Please help me out. Thanks.
warrior is offline   Reply With Quote
Old 06-08-2011, 08:58 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

basically, csv doesn't "support" images (csv = delimited text)
__________________
dany_dev is offline   Reply With Quote
Old 06-09-2011, 02:24 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 54
warrior is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
basically, csv doesn't "support" images (csv = delimited text)
Hi,

I need to create a excel supported file which contain text and images. Is there any other alternate file format should i follow?
warrior is offline   Reply With Quote
Old 06-09-2011, 07:19 AM   #4 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

xlsx, but you need to do something from scratch.....and will be really hard if you don't know what you need to do...
__________________
dany_dev is offline   Reply With Quote
Reply

Bookmarks

Tags
csv, image, iphone, nsdata

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: 325
7 members and 318 guests
chemistry, Dnnake, iOS.Lover, jenniead38, lendo, pbart, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

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