Hello all,

I want to display some text indicating a list of errors the user should correct 
before submitting data.

I am using a modal NSAlert in which i set a message with a localised string 
from a table.
I want to include the error details and for that I was setting the 
informativeText field but it doesn’t show up unless its a string literal. I 
need it to be a variable value.

I also tried setting an accessory view but nothing is showed.

The code that uses the accessory view is below.

        NSTextView *accessory = [[NSTextView alloc] 
initWithFrame:NSMakeRect(0,0,200,15)];
        NSFont *font = [NSFont systemFontOfSize:[NSFont systemFontSize]];
        NSDictionary *textAttributes = [NSDictionary dictionaryWithObject:font 
forKey:NSFontAttributeName];
        [accessory insertText: informativeText];
        [accessory setEditable:NO];
        [accessory setDrawsBackground:NO];
        
        NSAlert* errorAlert = [NSAlert 
alertWithMessageText:NSLocalizedStringFromTable(@"The user data is not valid. 
Correct it and try again", @"AccountInfoTab", @"The user data is not valid. 
Correct it and try again") defaultButton:nil alternateButton:nil 
otherButton:nil informativeTextWithFormat: @""];
        [errorAlert setAccessoryView: accessory];
        [errorAlert runModal];

InformativeText is an NSMutableString.

What I am trying to do is even possible, or am I doing anything wrong ?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to