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 10-09-2009, 12:18 PM   #1 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 44
Exclamation Copying UIImage and String to UIPasteboard

Hello once again,

I am having a problem copying both a UIImage and a String to the pasteboard.

if I use
Code:
pasteboard.image = myImage;
alone or
Code:
pasteboard.string = myString;
it works, but if I try to combine them using NSDictionary it doesn't work. Here is the code that I used

Code:
NSDictionary *item = [NSDictionary dictionaryWithObjectsAndKeys: myString, @"myfield", Image1.image,@"image", nil];
		pasteboard.items = [NSArray arrayWithObject:item];
shabzcohelp is offline   Reply With Quote
Old 10-11-2009, 06:25 PM   #2 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 44
Default

Quote:
Originally Posted by shabzcohelp View Post
Hello once again,

I am having a problem copying both a UIImage and a String to the pasteboard.

if I use
Code:
pasteboard.image = myImage;
alone or
Code:
pasteboard.string = myString;
it works, but if I try to combine them using NSDictionary it doesn't work. Here is the code that I used

Code:
NSDictionary *item = [NSDictionary dictionaryWithObjectsAndKeys: myString, @"myfield", Image1.image,@"image", nil];
		pasteboard.items = [NSArray arrayWithObject:item];
bump! Does anyone know how to do this?
shabzcohelp is offline   Reply With Quote
Old 12-01-2009, 08:14 AM   #3 (permalink)
Registered Member
 
mebarron's Avatar
 
Join Date: Apr 2009
Location: Michigan
Posts: 47
Default Found a solution for you

Quote:
Originally Posted by shabzcohelp View Post
bump! Does anyone know how to do this?
static NSString *string = @"http://www.mobileorchard.com";
NSDictionary *item = [NSDictionary dictionaryWithObjectsAndKeys:
string, @"public.utf8-plain-text", [NSURL URLWithString:string],
(NSString *)kUTTypeURL,
nil];
pasteboard.items = [NSArray arrayWithObject:item];
mebarron is offline   Reply With Quote
Reply

Bookmarks

Tags
nsdictionary, nsstring, uiimage, uipasteboard

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: 266
16 members and 250 guests
ADY, Alsahir, Dani77, Desert Diva, Duncan C, F_Bryant, Grinarn, HemiMG, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,761
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

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