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 11-02-2010, 03:44 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 18
marco_mn is on a distinguished road
Default Using Data from one View in the another view?

Hello Users,

i have implemented two viewControllers:
CoverFlowViewController and ChartViewController
now i need an UIImage from CovverFlow.... in chartViewController,
this is my ChartViewController.h:

Code:
#import <UIKit/UIKit.h>

@class RootViewController;
@class CoverFlowViewController;
@interface ChartViewController : UIViewController {
	RootViewController *rootViewController;
	CoverFlowViewController *coverFlow;
}

@property (nonatomic, retain) RootViewController *rootViewController;
@property (nonatomic, retain) CoverFlowViewController *coverFlow;

- (IBAction) goToCoverFlow;


@end
and this is the method in ChartViewController.m where i need the UIImage:

Code:
- (void)viewDidLoad {
	
	UIImage *img = coverFlow.imageView.image;
	UIImageView *imageView = [[UIImageView alloc] initWithImage:img];
	
	[self.view addSubview:imageView];
    [super viewDidLoad];
}
But here in the first line coverFlow is 0x0, why?

Could anyone help me, please?
marco_mn is offline   Reply With Quote
Old 11-03-2010, 01:58 AM   #2 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 18
marco_mn is on a distinguished road
Default

Has no one a solution for my problem?
marco_mn is offline   Reply With Quote
Old 11-03-2010, 03:31 AM   #3 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 1
iPhoneTurk is on a distinguished road
Default

you didnt create any CoverFlow yet.

Code:
coverFlow=[[CoverFlowViewController alloc]init];
UIImage *img = coverFlow.imageView.image;
.....
iPhoneTurk is offline   Reply With Quote
Old 11-03-2010, 09:50 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 18
marco_mn is on a distinguished road
Default

Hey,

thank you for your answer,
but now is imageView 0x0,
do you know why that is so?

Greetings Marco
marco_mn is offline   Reply With Quote
Old 11-03-2010, 10:03 AM   #5 (permalink)
Registered Member
 
Join Date: Jun 2010
Location: Last spotted in MD.
Posts: 17
LazyCoder is on a distinguished road
Default

How is the designated initializer implemented in CoverFlowViewController?
Where did it get the data from?
LazyCoder is offline   Reply With Quote
Old 11-04-2010, 04:02 AM   #6 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 18
marco_mn is on a distinguished road
Default

Hey LazyCoder,

look this is the CoverFlowViewController.m where I will get
the data from:

Code:
- (IBAction)goToChart {
	UIImage *img = imageView.image;
	[rootViewController switchViews];

}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	UIButton *weiter = [UIButton buttonWithType:UIButtonTypeRoundedRect];
	weiter.frame = CGRectMake(100, 400, 120, 40);
	[weiter addTarget:self action:@selector(goToChart) forControlEvents:UIControlEventTouchUpInside];
	NSString *ansicht = @"Weiter";
	[weiter setTitle:ansicht forState:UIControlStateNormal];
	[self.view addSubview:weiter];
	// loading images into the queue
	
	loadImagesOperationQueue = [[NSOperationQueue alloc] init];
	
	NSString *imageName;
	for (int i=0; i < 10; i++) {
		imageName = [[NSString alloc] initWithFormat:@"cover_%d.jpg", i];
		imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
		UIImage *aktuellesImage = imageView.image;
		UIImage *scaledImage = [aktuellesImage scaleToSize:CGSizeMake(100.0f, 100.0f)];
		[(AFOpenFlowView *)self.view setImage:scaledImage forIndex:i];
		[imageName release];
		NSLog(@"%d is the index",i);
		
	}
	[(AFOpenFlowView *)self.view setNumberOfImages:10];
	
}
i need the actual picture of the imageView, you understand me?

Greetings Marco
marco_mn is offline   Reply With Quote
Reply

Bookmarks

Tags
multiple-views, uiimage, viewdidload

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: 337
12 members and 325 guests
7twenty7, chiataytuday, condor304, Creativ, Domele, dreamdash3, laureix68, LEARN2MAKE, mistergreen2011, mottdog, palme2elie, Paul Slocum
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,660
Threads: 94,119
Posts: 402,896
Top Poster: BrianSlick (7,990)
Welcome to our newest member, laureix68
Powered by vBadvanced CMPS v3.1.0

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