NSlocalizedstring没有出现在uialertview上

时间:2014-11-21 05:57:22

标签: ios objective-c uialertview

我正在制作一个应用程序,我想要显示uialert视图。我给这个uialertview提供了NSLocalized字符串。但是我的Nslocalized字符串没有出现在uialertview上,只显示空警报视图。我无法理解下面的问题是我的代码:

if(!self.transporterCompanyName_.text || [self.transporterCompanyName_.text isEqualToString:@""] || !self.transporterLastName_.text || [self.transporterLastName_.text isEqualToString:@""] || !self.transporterFirstName_.text || [self.transporterFirstName_.text isEqualToString:@""] || !self.transporterEmail_.text || [self.transporterEmail_.text isEqualToString:@""] || !self.transporterTelNo_.text || [self.transporterTelNo_.text isEqualToString:@""] || !self.transporterUserName_.text || [self.transporterUserName_.text isEqualToString:@""] || !self.transporterPassword_.text || [self.transporterPassword_.text isEqualToString:@""] || !self.transporterConfirmPassword_.text || [self.transporterConfirmPassword_.text isEqualToString:@""]){

        [FBMessageHandler displayAlertMessageWithOkButton:NSLocalizedString(@"All text fields are mandatory. Please fill the complete form and then submit!", @"incomplete reg form") backgroundImage:nil tag:0 andDelegate:self addInQueue:NO andParentViewController:self];

        return;
    } 

这是我的FbMessageHandler

+ (void)displayAlertMessageWithOkButton:(NSString *)message backgroundImage:(NSString*)bImage
                                  tag:(int)tagValue
                            andDelegate:(id)delegate addInQueue:(BOOL)queue andParentViewController:(UIViewController *)viewController
{
    FBAlertViewController *alert = [[FBAlertViewController alloc] initWithNibName:@"FBAlertWithOkOption" andMessage:message backgroundImage:bImage tag:tagValue andDelegate:delegate addInQueue:queue buttonText:nil];
    [viewController addChildViewController:alert];
    [viewController.view addSubview:alert.view];
    [alert didMoveToParentViewController:viewController];
    alert = nil;
}

提前完成

1 个答案:

答案 0 :(得分:0)

试试这个

 [FBMessageHandler displayAlertMessageWithOkButton:NSLocalizedString(@"All text fields are mandatory. Please fill the complete form and then submit!", @"incomplete reg form") backgroundImage:nil tag:0 andDelegate:self addInQueue:NO andParentViewController:self];

进入

    [FBMessageHandler displayAlertMessageWithOkButton:NSLocalizedString(@"All text fields are mandatory. Please fill the complete form and then submit!, incomplete reg form") backgroundImage:nil tag:0 andDelegate:self addInQueue:NO andParentViewController:self];

选择否2

    NSString *msgstr=[NSString stringWithFormat:@"All text fields are mandatory. Please fill the complete form and then submit!,incomplete reg form"];


   [FBMessageHandler displayAlertMessageWithOkButton:msgstr backgroundImage:nil tag:0 andDelegate:self addInQueue:NO andParentViewController:self];