xcode objcet c 函数定义和使用

操作系统:mac os 10.8 64

语言:objcect c

开发环境:Xcode4.6

功能:函数定义和使用

- (BOOL)sendEmailTo:(NSString *)paramTo withSubject:(NSString *)paramSubject andEmailMessage:(NSString *)paramEmailMessage;
- (BOOL)sendEmailTo:(NSString *)paramTo withSubject:(NSString *)paramSubject andEmailMessage:(NSString *)paramEmailMessage
{
    if(paramTo.length == 0 ||
       paramSubject.length == 0 ||
       paramEmailMessage.length == 0)
    {
        
        NSLog(@"sendemail is null");
        return NO;
    }
    else
    {
        NSLog(paramTo);
        NSLog(paramSubject);
        NSLog(paramEmailMessage);
        NSLog(@"send success");
        return YES;
    }
}
- (IBAction)clearLabelMsg:(id)sender {    
    NSString *msg = @"wujinlang";
    NSString *msgLen = [NSString stringWithFormat:@"%d",msg.length];
    NSLog(msgLen);
    
    char *myName = "wujinlang";
    NSUInteger counter = 0;
    for(counter=0;counter<strlen(myName);counter++){
        char character = myName[counter];
        NSLog(@"%c-----",character);     }
    
    [self sendEmailTo:@"[email protected]" withSubject:@"testMsg" andEmailMessage:@"testmsg2"];
}

你可能感兴趣的:(xcode objcet c 函数定义和使用)