• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to display alert box in COCOA
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to display alert box in COCOA


  • Subject: Re: How to display alert box in COCOA
  • From: Lorenzo <email@hidden>
  • Date: Fri, 05 Dec 2003 17:24:21 +0100

The code
-------------
int retCode = 10;
NSString *theAlertMessage = [NSString stringWithFormat:
@"Return code is %d", retCode];
NSRunAlertPanel( @"Error", theAlertMessage, @"OK", nil, nil );
-------------
is ok.

I suppose you do something wrong later, like releasing the string
theAlertMessage with something like
-------------
[theAlertMessage release];
-------------
If so, you don't have to release that string.
Also, are you running the NSRunAlertPanel within a thread?


Best Regards
--
Lorenzo
email: email@hidden


> Reply-To: <email@hidden>
> From: "Shashikant Hire" <email@hidden>
> To: <email@hidden>
> Subject: How to display alert box in COCOA
> Date: Fri, 5 Dec 2003 17:27:15 +0530
>
> Hello
>
> I want to display an alert box. Application run successfully but alert is
> displayed
> on screen. Following message is displayed in output window of Project
> Builder.
>
> 2003-12-05 05:34:33.489 Hello[851] *** _NSAutotreleaseNoPool(): Object
> 0x9af70 of
> class NSCFString autoreleased with no pool in place - just leaking
>
> Following is code.
>
> int retCode = 10;
>
> NSString *theAlertMessage = [NSString stringWithFormat:@"Return code is %d",
> retCode];
> NSRunAlertPanel( @"Error", theAlertMessage, @"OK", nil, nil );
>
>
> Regards
> SBH
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Alerts from a Preference Pane
  • Next by Date: Re: reading iTunesDB
  • Previous by thread: Re: How to display alert box in COCOA
  • Next by thread: Drawing in Cocoa
  • Index(es):
    • Date
    • Thread