Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RobRiley

macrumors member
Original poster
Feb 4, 2009
35
0
London
Hi,

I'm sure someone will answer this in minutes :)

I want to put the contents of an NSAlert accessory view into an NSString but don't know the correct syntax. Here's a broken down example of what I have:

Code:
NSTextView *accessory = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,200,40)];
	[accessory insertText:[[NSAttributedString alloc] init]];
	[accessory setEditable:YES];
	[accessory setDrawsBackground:YES];
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert setAccessoryView:accessory];
[alert addButtonWithTitle:NSLocalizedString(@"OK", nil)];
NSInteger choice = [alert runModal];
// get accessory view as string here!!

Thanks in advance!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.