<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.gnustep.org/index.php?action=history&amp;feed=atom&amp;title=NSAlert</id>
	<title>NSAlert - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.gnustep.org/index.php?action=history&amp;feed=atom&amp;title=NSAlert"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.gnustep.org/index.php?title=NSAlert&amp;action=history"/>
	<updated>2026-06-11T08:12:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.7</generator>
	<entry>
		<id>https://mediawiki.gnustep.org/index.php?title=NSAlert&amp;diff=6535&amp;oldid=prev</id>
		<title>Awiebe at 08:13, 15 April 2013</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.gnustep.org/index.php?title=NSAlert&amp;diff=6535&amp;oldid=prev"/>
		<updated>2013-04-15T08:13:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{stub}}&lt;br /&gt;
NSAlert is a modal dialog or [[sheet]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c_max&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
NS Alert Example*/&lt;br /&gt;
&lt;br /&gt;
NSAlert* a = [ NSAlert alertWithMessageText:@&amp;quot;title&amp;quot; defaultButton:@&amp;quot;ok&amp;quot; alternateButton:@&amp;quot;cancel&amp;quot; otherButton:nil informativeTextWithFormat:@&amp;quot;more information ];&lt;br /&gt;
&lt;br /&gt;
//Run as a dialog&lt;br /&gt;
NSInteger returnCode = [a runModal];&lt;br /&gt;
switch(returnCode)&lt;br /&gt;
{&lt;br /&gt;
case 1:&lt;br /&gt;
&lt;br /&gt;
//ok&lt;br /&gt;
break;&lt;br /&gt;
&lt;br /&gt;
case 2:&lt;br /&gt;
&lt;br /&gt;
//cancel&lt;br /&gt;
break;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Attach to window&lt;br /&gt;
[a beginSheetModalForWindow:windowP modalDelegate:self didEndSelector:@selector(alertDidEnd:) contextInfo:nil];&lt;br /&gt;
&lt;br /&gt;
- (void) alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo&lt;br /&gt;
{&lt;br /&gt;
switch(returnCode)&lt;br /&gt;
{&lt;br /&gt;
case 1:&lt;br /&gt;
//ok&lt;br /&gt;
break;&lt;br /&gt;
case 2:&lt;br /&gt;
//cancel&lt;br /&gt;
break;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==See also==&lt;br /&gt;
* [https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSAlert_Class/Reference/Reference.html Apple on NSAlert]&lt;/div&gt;</summary>
		<author><name>Awiebe</name></author>
	</entry>
</feed>