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

View Single Post
Old 09-27-2010, 01:15 AM   #9 (permalink)
kgupta
Registered Member
 
Join Date: Sep 2010
Location: India
Posts: 26
kgupta is on a distinguished road
Default

I am getting same errors, please guide.

Thanks.

Quote:
Originally Posted by xoshi101 View Post
When I put this in my MainViewController.m file, it causes a build error.

Here's what I want to do. There's a void in my MainViewController.m file that I want to be able to call from MainView.m. This void needs to display the in-app email form.

MainViewController.h
Code:
- (void)showEmailModalView:(NSString*) storyText;
This is the function I want to call. storyText is the string that I want to display in the body of the email.

MainView.h
Code:
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
@class MainViewController;
@interface MainView : UIView {
	IBOutlet UITextField *userName;
	IBOutlet UISegmentedControl *userGender;
	IBOutlet UITextView *storyBox;
	
	MainViewController *controller;
}

@property (nonatomic, retain) MainViewController *controller;
MainView.m
Code:
#import "MainView.h"
#import "MainViewController.h"
//import email sheet stuff
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>

@implementation MainView

@synthesize controller;

//bunch of other program code

//email function
-(IBAction)emailStory {
	//check if user entered a name
	NSLog(@"MainView.m -(IBAction)emailStory called");
	if(storyName==nil) {
		//display warning
	} else {
		NSString *storyTextToEmail = [storyBox text];
		[controller showEmailModalView:storyTextToEmail];
	}
}
XCode isn't giving me warnings or errors, but when I put self.view.controller = self; or MainView.controller = self; in the viewDidLoad as stated above, it gives me errors.

If I use self.view.controller = self;, XCode says
error: request for member 'controller' in something not a structure or union

If I use MainView.controller = self;, XCode says
error: accessing unknown 'setController:' class method
error: object cannot be set - either readonly property or no setter found

Any suggestions? I'm completely stumped by this.
kgupta is offline   Reply With Quote
 

» Advertisements
» Online Users: 423
12 members and 411 guests
chits12345, daniljan, darrenshain, ephefei, erdinc27, EvilElf, ipodphone, JmayLive, linkmx, Mnadeep, observer247, tomtom100
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,588
Threads: 94,083
Posts: 402,775
Top Poster: BrianSlick (7,990)
Welcome to our newest member, daniljan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:38 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.