Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 邮件生成器在Xcode中给出了一个错误_Objective C_Xcode_Email - Fatal编程技术网

Objective c 邮件生成器在Xcode中给出了一个错误

Objective c 邮件生成器在Xcode中给出了一个错误,objective-c,xcode,email,Objective C,Xcode,Email,我正在尝试使用iOS应用程序发送邮件 方法如下: MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:@"Reclutamento pompieri"]; // Set up the recipients. NSArray *toR

我正在尝试使用iOS应用程序发送邮件

方法如下:

    MFMailComposeViewController  *picker = [[MFMailComposeViewController  alloc] init];
    picker.mailComposeDelegate = self;

    [picker setSubject:@"Reclutamento pompieri"];

    // Set up the recipients.
    NSArray *toRecipients = [NSArray arrayWithObjects:@"test@gmail.com",nil];

    [picker setToRecipients:toRecipients];


    testoMail = [NSMutableString stringWithFormat: @"This is a test"];

    [picker setMessageBody:testoMail isHTML:YES]; //HTML!!!!!!

        [self presentViewController:picker animated:YES completion:nil];

//*******************************************************************************************

     // The mail compose view controller delegate method
            - (void)mailComposeController:(MFMailComposeViewController *)controller //**ERROR STAYS HERE**
            didFinishWithResult:(MFMailComposeResult)result
            error:(NSError *)error
            {
                [self dismissModalViewControllerAnimated:YES]

;
但调试器显示“使用了未声明的标识符”MailComposer控制器

我不明白这是什么意思。 你能帮我吗

非常感谢你

注:标题为:

#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>

@interface Reclutamento : UIViewController <MFMailComposeViewControllerDelegate>
{

}

- (void)sendMail;

@end
#导入
#进口
@接口Reclutatemento:UIViewController
{
}
-(无效)发送邮件;
@结束
完整的.h代码是

//
//  Reclutamento.h
//  Pompieri
//
//  Created by Reda Bousbah on 15.01.13.
//  Copyright (c) 2013 Reda Bousbah. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>

@interface Reclutamento : UIViewController <MFMailComposeViewControllerDelegate>
{
    UITextField *nameTextField;
    UITextField *surnameTextField;
    UITextField *bornDateTextField;
    UITextField *addressTextField;
    UITextField *zipTextField;
    UITextField *emailTextField;

    MFMailComposeViewController *email;
}

@property (nonatomic, retain) MFMailComposeViewController *email;

@property(nonatomic,retain) IBOutlet UITextField *nameTextField;
@property(nonatomic,retain) IBOutlet UITextField *surnameTextField;
@property(nonatomic,retain) IBOutlet UITextField *bornDateTextField;
@property(nonatomic,retain) IBOutlet UITextField *addressTextField;
@property(nonatomic,retain) IBOutlet UITextField *zipTextField;
@property(nonatomic,retain) IBOutlet UITextField *emailTextField;

@property NSString *name;
@property NSString *surname;
@property NSString *bornDate;
@property NSString *address;
@property NSString *zipCode;
@property NSString *miaEmail;


- (IBAction)checkData:(id)sender;
- (IBAction)backgroundTap:(id)sender;
- (IBAction)doneButtonPressed:(id)sender;

- (void)sendMail;

@end
//
//Reclutatemento.h
//蓬皮里
//
//由Reda Bousbah于2013年1月15日创建。
//版权所有(c)2013 Reda Bousbah。保留所有权利。
//
#进口
#进口
#进口
@接口Reclutatemento:UIViewController
{
UITextField*名称文本字段;
UITextField*姓氏textfield;
UITextField*BornDataTextField;
UITextField*地址文本字段;
UITextField*zipTextField;
UITextField*emailTextField;
MFMailComposeViewController*电子邮件;
}
@属性(非原子,保留)MFMailComposeViewController*电子邮件;
@属性(非原子,保留)IBOutlet UITextField*nameTextField;
@属性(非原子,保留)IBOutlet UITextField*姓氏textfield;
@属性(非原子,保留)IBOutlet UITextField*BornDataTextField;
@属性(非原子,保留)IBOutlet UITextField*addressTextField;
@属性(非原子,保留)IBOutlet UITextField*zipTextField;
@属性(非原子,保留)IBOutlet UITextField*emailTextField;
@属性字符串*名称;
@属性字符串*姓氏;
@属性NSString*bornDate;
@属性字符串*地址;
@属性NSString*zipCode;
@属性NSString*miaEmail;
-(iAction)检查数据:(id)发送方;
-(iAction)背景点击:(id)发送者;
-(iAction)doneButtonPressed:(id)发送方;
-(无效)发送邮件;
@结束
实现文件是

//
//  Reclutamento.m
//  Pompieri
//
//  Created by Reda Bousbah on 15.01.13.
//  Copyright (c) 2013 Reda Bousbah. All rights reserved.
//

#import "Reclutamento.h"
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>

@interface Reclutamento ()

@end


@implementation Reclutamento

@synthesize nameTextField, surnameTextField, bornDateTextField, addressTextField, zipTextField, emailTextField;
@synthesize name, surname, bornDate, address, zipCode, miaEmail;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    nameTextField.text = nil;
    surnameTextField.text = nil;
    bornDateTextField.text = nil;
    addressTextField.text = nil;
    zipTextField.text = nil;
    emailTextField.text = nil;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}

#pragma - getting info from the UI

//NSString *test = nil;


- (IBAction)checkData:(id)sender
{
    /*
    name = nameTextField.text;
    surname = surnameTextField.text;
    bornDate = bornDateTextField.text;
    address = addressTextField.text;
    zipCode = zipTextField.text;
    email = emailTextField.text;
    */

    //NSLog(@" Nome: %@ \n Cognome: %@ \n Data di nascita: %@ \n Indirizzo: %@ \n Zip: %@ \n email: %@ \n", name, surname, bornDate, address, zipCode, email);

    unsigned int x,a = 0;
    NSMutableString *messaggioErrore; //stringa variabile
    messaggioErrore = [NSMutableString stringWithFormat: @""]; //le stringhe mutabili vanno inizializzate in questo modo!


    for (x=0; x<6; x++)
    {
        switch (x) {
            case 0:
                if (nameTextField.text == nil) {
                    [messaggioErrore appendString:@"Nome, "];
                    a=1;

                }
                break;

            case 1:
                if (surnameTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Cognome, "];
                    a=1;
                }
                break;

            case 2:
                if (bornDateTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Data di nascita, "];
                    a=1;
                }
                break;

            case 3:
                if (addressTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Indirizzo, "];
                    a=1;
                }
                break;

            case 4:
                if (zipTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Zip Code, "];
                    a=1;
                }
                break;

            case 5:
                if (emailTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Email, "];
                    a=1;
                }
                break;

            default:
                break;
        }

    }

    NSLog (@"Messaggio errore: %@", messaggioErrore);

     if (a == 1) {

         NSMutableString  *popupErrore;
         popupErrore = [NSMutableString stringWithFormat: @"Per inviare compilare i seguenti campi:  "];

         [popupErrore appendString:messaggioErrore]; //aggiungo i miei errori
         [popupErrore appendString: @" grazie della comprensione."]; //

         NSLog(@"%@", popupErrore);

        UIAlertView *chiamataEffettuata = [[UIAlertView alloc]
                                           initWithTitle:@"ATTENZIONE" //titolo del mio foglio
                                           message:popupErrore
                                           delegate:self
                                           cancelButtonTitle:@"Ok, correggo" //bottone con cui si chiude il messaggio
                                           otherButtonTitles:nil, nil];
        [chiamataEffettuata show]; //istanza per mostrare effettivamente il messaggio
     }

    else
    {
        name = nameTextField.text;
        surname = surnameTextField.text;
        bornDate = bornDateTextField.text;
        address = addressTextField.text;
        zipCode = zipTextField.text;
        email = emailTextField.text;

        NSMutableString *datiUtente;
        datiUtente = [NSMutableString stringWithFormat: @"<br><br> <b>Nome:</b> %@ <br> <b>Cognome:</b> %@ <br> <b>Data di nascita:</b> %@ <br> <b>Indirizzo:</b> %@ <br> <b>Zip:</b> %@ <br> <b>Email:</b> %@ <br>", name, surname, bornDate, address, zipCode, miaEmail];

        NSLog(@"Dati utente: %@", datiUtente);

        NSMutableString *testoMail;
        testoMail = [NSMutableString stringWithFormat: @"Salve, questa mail è stata generata automaticamente dalla applicazione per iPhone ''<b>Pompieri Locarno</b>'' <br> i dati relativi all'utente sono: %@", datiUtente];

        NSLog(@"%@", testoMail);


        //MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
        MFMailComposeViewController  *picker = [[MFMailComposeViewController  alloc] init];
        picker.mailComposeDelegate = self;

        [picker setSubject:@"Reclutamento pompieri"];

        // Set up the recipients.
        NSArray *toRecipients = [NSArray arrayWithObjects:@"youporn@gmail.com",nil];

        //NSArray *ccRecipients = [NSArray arrayWithObjects:@"second@example.com",@"third@example.com", nil];
        //NSArray *bccRecipients = [NSArray arrayWithObjects:@"four@example.com",nil];

        [picker setToRecipients:toRecipients];
        //[picker setCcRecipients:ccRecipients];
        //[picker setBccRecipients:bccRecipients];

        // Attach an image to the email.
        //NSString *path = [[NSBundle mainBundle] pathForResource:@"ipodnano" ofType:@"png"];
        //NSData *myData = [NSData dataWithContentsOfFile:path];
        //[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"ipodnano"];

        // Fill out the email body text.
        //NSMutableString *emailBody;
        testoMail = [NSMutableString stringWithFormat: @"%@", testoMail];

        [picker setMessageBody:testoMail isHTML:YES]; //HTML!!!!!!

        // Present the mail composition interface.
        [self presentViewController:picker animated:YES completion:nil];

        // The mail compose view controller delegate method
        - (void)mailComposeController:(MFMailComposeViewController *)controller
        didFinishWithResult:(MFMailComposeResult)result
        error:(NSError *)error
        {
            [self dismissModalViewControllerAnimated:YES];
        }
    }
}

#pragma mark - Mandare email
/*
- (void)sendMail:(NSMutableString*)testoMail{

    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;

    [picker setSubject:@"Reclutamento pompieri"];

    // Set up the recipients.
    NSArray *toRecipients = [NSArray arrayWithObjects:@"reda.bousbah@gmail.com",nil];
    //NSArray *ccRecipients = [NSArray arrayWithObjects:@"second@example.com",@"third@example.com", nil];
    //NSArray *bccRecipients = [NSArray arrayWithObjects:@"four@example.com",nil];

    [picker setToRecipients:toRecipients];
    //[picker setCcRecipients:ccRecipients];
    //[picker setBccRecipients:bccRecipients];

    // Attach an image to the email.
    //NSString *path = [[NSBundle mainBundle] pathForResource:@"ipodnano" ofType:@"png"];
    //NSData *myData = [NSData dataWithContentsOfFile:path];
    //[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"ipodnano"];

    // Fill out the email body text.
    NSString *emailBody = @"It is raining in sunny California!";
    [picker setMessageBody:emailBody isHTML:NO];

    // Present the mail composition interface.
    [self presentViewController:picker animated:YES completion:nil];


}
*/

#pragma mark - methods to control the keyboard

- (IBAction)backgroundTap:(id)sender //method for resign the keyboard when the background is tapped
{
    [nameTextField resignFirstResponder];
    [surnameTextField resignFirstResponder];
    [bornDateTextField resignFirstResponder];
    [addressTextField resignFirstResponder];
    [zipTextField resignFirstResponder];
    [emailTextField resignFirstResponder];

}

- (IBAction)doneButtonPressed:(id)sender
{
    NSLog( @"done button pressed");
    [sender resignFirstResponder];
}

@end
//
//Reclutatemento.m
//蓬皮里
//
//由Reda Bousbah于2013年1月15日创建。
//版权所有(c)2013 Reda Bousbah。保留所有权利。
//
#导入“Reclutatemento.h”
#进口
#进口
@接口重合度()
@结束
@实现重合闸
@合成nameTextField、nameTextField、BornDataTextField、addressTextField、zipTextField、emailTextField;
@综合姓名、姓氏、出生地、地址、邮政编码、miaEmail;
-(id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
{
self=[super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
如果(自我){
//自定义初始化
}
回归自我;
}
-(无效)viewDidLoad
{
[超级视图下载];
//加载视图后执行任何其他设置。
nameTextField.text=nil;
姓氏textfield.text=nil;
borndatextfield.text=nil;
addressTextField.text=nil;
zipTextField.text=nil;
emailTextField.text=nil;
}
-(无效)未收到记忆警告
{
[超级记忆警告];
//处置所有可以重新创建的资源。
}
-(整数)支持的接口方向{
返回UIInterfaceOrientationMaskLandscape;
}
#pragma-从UI获取信息
//NSString*测试=nil;
-(iAction)检查数据:(id)发送方
{
/*
name=nameTextField.text;
姓氏=姓氏文本字段.text;
bornDate=bornDateTextField.text;
地址=addressTextField.text;
zipCode=zipTextField.text;
email=emailTextField.text;
*/
//NSLog(@“Nome:%@\n Cognome:%@\n nascita数据:%@\n Indirizzo:%@\n Zip:%@\n电子邮件:%@\n”、姓名、姓氏、出生地、地址、邮编、电子邮件);
无符号整数x,a=0;
NSMutableString*messaggioErrore;//字符串变量
MessaggioError=[NSMutableString stringWithFormat:@”“];//le stringhe mutabili vanno-inazializate in questo modo!
对于(x=0;ximport

#import <MessageUI/MFMailComposeViewController.h>
#导入

似乎您已经在方法中定义了
-(void)mailComposeController:(MFMailComposeViewController*)控制器。
请在方法之外定义此项


编辑

正如我所说,将定义移出方法。 这是您完整正确的.m文件

//
//  Reclutamento.m
//  Pompieri
//
//  Created by Reda Bousbah on 15.01.13.
//  Copyright (c) 2013 Reda Bousbah. All rights reserved.
//

#import "Reclutamento.h"
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>

@interface Reclutamento ()

@end


@implementation Reclutamento

@synthesize nameTextField, surnameTextField, bornDateTextField, addressTextField, zipTextField, emailTextField;
@synthesize name, surname, bornDate, address, zipCode, miaEmail;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    nameTextField.text = nil;
    surnameTextField.text = nil;
    bornDateTextField.text = nil;
    addressTextField.text = nil;
    zipTextField.text = nil;
    emailTextField.text = nil;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}

#pragma - getting info from the UI

//NSString *test = nil;


- (IBAction)checkData:(id)sender
{
    /*
     name = nameTextField.text;
     surname = surnameTextField.text;
     bornDate = bornDateTextField.text;
     address = addressTextField.text;
     zipCode = zipTextField.text;
     email = emailTextField.text;
     */

    //NSLog(@" Nome: %@ \n Cognome: %@ \n Data di nascita: %@ \n Indirizzo: %@ \n Zip: %@ \n email: %@ \n", name, surname, bornDate, address, zipCode, email);

    unsigned int x,a = 0;
    NSMutableString *messaggioErrore; //stringa variabile
    messaggioErrore = [NSMutableString stringWithFormat: @""]; //le stringhe mutabili vanno inizializzate in questo modo!


    for (x=0; x<6; x++)
    {
        switch (x) {
            case 0:
                if (nameTextField.text == nil) {
                    [messaggioErrore appendString:@"Nome, "];
                    a=1;

                }
                break;

            case 1:
                if (surnameTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Cognome, "];
                    a=1;
                }
                break;

            case 2:
                if (bornDateTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Data di nascita, "];
                    a=1;
                }
                break;

            case 3:
                if (addressTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Indirizzo, "];
                    a=1;
                }
                break;

            case 4:
                if (zipTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Zip Code, "];
                    a=1;
                }
                break;

            case 5:
                if (emailTextField.text == nil)
                {
                    [messaggioErrore appendString:@"Email, "];
                    a=1;
                }
                break;

            default:
                break;
        }

    }

    NSLog (@"Messaggio errore: %@", messaggioErrore);

    if (a == 1) {

        NSMutableString  *popupErrore;
        popupErrore = [NSMutableString stringWithFormat: @"Per inviare compilare i seguenti campi:  "];

        [popupErrore appendString:messaggioErrore]; //aggiungo i miei errori
        [popupErrore appendString: @" grazie della comprensione."]; //

        NSLog(@"%@", popupErrore);

        UIAlertView *chiamataEffettuata = [[UIAlertView alloc]
                                           initWithTitle:@"ATTENZIONE" //titolo del mio foglio
                                           message:popupErrore
                                           delegate:self
                                           cancelButtonTitle:@"Ok, correggo" //bottone con cui si chiude il messaggio
                                           otherButtonTitles:nil, nil];
        [chiamataEffettuata show]; //istanza per mostrare effettivamente il messaggio
    }

    else
    {
        name = nameTextField.text;
        surname = surnameTextField.text;
        bornDate = bornDateTextField.text;
        address = addressTextField.text;
        zipCode = zipTextField.text;
        email = emailTextField.text;

        NSMutableString *datiUtente;
        datiUtente = [NSMutableString stringWithFormat: @"<br><br> <b>Nome:</b> %@ <br> <b>Cognome:</b> %@ <br> <b>Data di nascita:</b> %@ <br> <b>Indirizzo:</b> %@ <br> <b>Zip:</b> %@ <br> <b>Email:</b> %@ <br>", name, surname, bornDate, address, zipCode, miaEmail];

        NSLog(@"Dati utente: %@", datiUtente);

        NSMutableString *testoMail;
        testoMail = [NSMutableString stringWithFormat: @"Salve, questa mail è stata generata automaticamente dalla applicazione per iPhone ''<b>Pompieri Locarno</b>'' <br> i dati relativi all'utente sono: %@", datiUtente];

        NSLog(@"%@", testoMail);


        //MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
        MFMailComposeViewController  *picker = [[MFMailComposeViewController  alloc] init];
        picker.mailComposeDelegate = self;

        [picker setSubject:@"Reclutamento pompieri"];

        // Set up the recipients.
        NSArray *toRecipients = [NSArray arrayWithObjects:@"youporn@gmail.com",nil];

        //NSArray *ccRecipients = [NSArray arrayWithObjects:@"second@example.com",@"third@example.com", nil];
        //NSArray *bccRecipients = [NSArray arrayWithObjects:@"four@example.com",nil];

        [picker setToRecipients:toRecipients];
        //[picker setCcRecipients:ccRecipients];
        //[picker setBccRecipients:bccRecipients];

        // Attach an image to the email.
        //NSString *path = [[NSBundle mainBundle] pathForResource:@"ipodnano" ofType:@"png"];
        //NSData *myData = [NSData dataWithContentsOfFile:path];
        //[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"ipodnano"];

        // Fill out the email body text.
        //NSMutableString *emailBody;
        testoMail = [NSMutableString stringWithFormat: @"%@", testoMail];

        [picker setMessageBody:testoMail isHTML:YES]; //HTML!!!!!!

        // Present the mail composition interface.
        [self presentViewController:picker animated:YES completion:nil];
    }
}


// The mail compose view controller delegate method
- (void)mailComposeController:(MFMailComposeViewController *)controller
          didFinishWithResult:(MFMailComposeResult)result
                        error:(NSError *)error
{
    [self dismissModalViewControllerAnimated:YES];
}

#pragma mark - Mandare email
/*
 - (void)sendMail:(NSMutableString*)testoMail{

 MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
 picker.mailComposeDelegate = self;

 [picker setSubject:@"Reclutamento pompieri"];

 // Set up the recipients.
 NSArray *toRecipients = [NSArray arrayWithObjects:@"reda.bousbah@gmail.com",nil];
 //NSArray *ccRecipients = [NSArray arrayWithObjects:@"second@example.com",@"third@example.com", nil];
 //NSArray *bccRecipients = [NSArray arrayWithObjects:@"four@example.com",nil];

 [picker setToRecipients:toRecipients];
 //[picker setCcRecipients:ccRecipients];
 //[picker setBccRecipients:bccRecipients];

 // Attach an image to the email.
 //NSString *path = [[NSBundle mainBundle] pathForResource:@"ipodnano" ofType:@"png"];
 //NSData *myData = [NSData dataWithContentsOfFile:path];
 //[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"ipodnano"];

 // Fill out the email body text.
 NSString *emailBody = @"It is raining in sunny California!";
 [picker setMessageBody:emailBody isHTML:NO];

 // Present the mail composition interface.
 [self presentViewController:picker animated:YES completion:nil];


 }
 */

#pragma mark - methods to control the keyboard

- (IBAction)backgroundTap:(id)sender //method for resign the keyboard when the background is tapped
{
    [nameTextField resignFirstResponder];
    [surnameTextField resignFirstResponder];
    [bornDateTextField resignFirstResponder];
    [addressTextField resignFirstResponder];
    [zipTextField resignFirstResponder];
    [emailTextField resignFirstResponder];

}

- (IBAction)doneButtonPressed:(id)sender
{
    NSLog( @"done button pressed");
    [sender resignFirstResponder];
}

@end
//
//Reclutatemento.m
//蓬皮里
//
//由Reda Bousbah于2013年1月15日创建。
//版权所有(c)2013 Reda Bousbah。保留所有权利。
//
#导入“Reclutatemento.h”
#进口
#进口
@接口重合度()
@结束
@实现重合闸
@合成nameTextField、nameTextField、BornDataTextField、addressTextField、zipTextField、emailTextField;
@综合姓名、姓氏、出生地、地址、邮政编码、miaEmail;
-(id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
{
self=[super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
如果(自我){
//自定义初始化
}
回归自我;
}
-(无效)viewDidLoad
{
[超级视图下载];
//加载视图后执行任何其他设置。
nameTextField.text=nil;
姓氏textfield.text=nil;
borndatextfield.text=nil;
addressTextField.text=nil;
zipTextField.text=nil;
emailTextField.text=nil;
}
-(无效)未收到记忆警告
{
[超级记忆警告];
//处置所有可以重新创建的资源。
}
-(整数)支持的接口方向{
返回UIInterfaceOrientationMaskLandscape;
}
#pragma-从UI获取信息
//NSString*测试=nil;
-(iAction)检查数据:(id)发送方
{
/*
name=nameTextField.text;
姓氏=姓氏文本字段.text;
bornDate=bornDateTextField.text;
地址=addressTextField.text;
zipCode=zipTextField.text;
email=emailTextField.text;
*/
//NSLog(@“Nome:%@\n Cognome:%@\n nascita数据:%@\n Indirizzo:%@\n Zip:%@\n电子邮件:%@\n”、姓名、姓氏、出生地、地址、邮编、电子邮件);
无符号整数x,a=0;
NSMutableString*messaggioErrore;//字符串变量
MessaggioError=[NSMutableString stringWithFormat:@”“];//le stringhe mutabili vanno-inazializate in questo modo!

对于(x=0;x将MessageUI.framework添加到项目中。单击导航器中的项目,选择“构建阶段”,然后将其添加到“与库链接”部分下