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 10-09-2011, 06:55 PM   #1 (permalink)
Registered Member
 
TheFlyingDutchman's Avatar
 
Join Date: Feb 2011
Location: NYC
Posts: 81
TheFlyingDutchman is on a distinguished road
Default Passing UIImage between Classes

Hi all,

I'm trying to pass a UIImage from one class to another either through a function
Code:
-(void)setImage:(UIImage *)image;
(which does not work) and through a property, which too does not work. When I go to print out what the image passed looks like:
Code:
NSLog(@"Image is: %@", myImageClass.image);
It returns (null).

Please help!

Dutchman


Farmboistudios.com
TheFlyingDutchman is offline   Reply With Quote
Old 10-09-2011, 07:00 PM   #2 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Post the code where you are passing the image. And what kind of property is it?
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 10-09-2011, 09:12 PM   #3 (permalink)
Registered Member
 
TheFlyingDutchman's Avatar
 
Join Date: Feb 2011
Location: NYC
Posts: 81
TheFlyingDutchman is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
Post the code where you are passing the image. And what kind of property is it?
I pretty much gave you the code, but if you insist:

Code:
@property (nonatomic, retain)UIImage *image;
But I also have this function in the other class were the users sets the image of the person:

Code:
-(void)setImageOfPerson:(UIImage *)image3{

	[image setImage:image3];
	
}
So it gets called:

Code:
[setupClass setImageOfPerson:imageOfPerson1];

Thanks for your help!
TheFlyingDutchman is offline   Reply With Quote
Old 10-10-2011, 01:59 AM   #4 (permalink)
Registered Member
 
SundialSoft's Avatar
 
Join Date: Oct 2010
Location: Scotland
Posts: 176
SundialSoft is on a distinguished road
Default passing to a class ?

Assuming this is passing to a class just for the class to do something behind the scenes (not passing to another view controller)
Code:
        UIImage *image=[ UIImage imageNamed: @"backPattern2.png"];
        UIImage *coloredImage = [tintImage colorizeImage: image color: color];  
        self->tableView.backgroundColor = [UIColor colorWithPatternImage:coloredImage];
will pass the image to the 'tintImage' class

If it was to a view controller I would pass using init. There's a good core data sample out there called cities showing this technique.
SundialSoft is offline   Reply With Quote
Old 10-10-2011, 11:40 AM   #5 (permalink)
Registered Member
 
TheFlyingDutchman's Avatar
 
Join Date: Feb 2011
Location: NYC
Posts: 81
TheFlyingDutchman is on a distinguished road
Default

Quote:
Originally Posted by SundialSoft View Post
Assuming this is passing to a class just for the class to do something behind the scenes (not passing to another view controller)
Code:
        UIImage *image=[ UIImage imageNamed: @"backPattern2.png"];
        UIImage *coloredImage = [tintImage colorizeImage: image color: color];  
        self->tableView.backgroundColor = [UIColor colorWithPatternImage:coloredImage];
will pass the image to the 'tintImage' class

If it was to a view controller I would pass using init. There's a good core data sample out there called cities showing this technique.

Yes, it is passing it to a View (XIB) with a class in it. Is there a way I could maybe manage to save it into a Dictionary, or through a function?
TheFlyingDutchman is offline   Reply With Quote
Reply

Bookmarks

Tags
passing, uiimage

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: 400
18 members and 382 guests
13dario13, 7twenty7, eski, EvilElf, glenn_sayers, HemiMG, jarv, LunarMoon, morterbaher, n00b, pbart, Pudding, QuantumDoja, sacha1996, Sami Gh, UMAD, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

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