• 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: ARC query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC query


  • Subject: Re: ARC query
  • From: Sean McBride <email@hidden>
  • Date: Wed, 07 Jan 2015 15:55:20 -0500
  • Organization: Rogue Research Inc.

On Wed, 7 Jan 2015 12:02:16 -0600, Ken Thomases said:

>Short answer: yes, the alert is retained.

Meaning that one must use the weak/strong dance pattern like this?

NSAlert *alert = [NSAlert new];
alert.alertStyle = NSWarningAlertStyle;
alert.messageText =  @“Do not touch!";
__weak NSAlert* weakAlert = alert;
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
 NSAlert *strongAlert = weakAlert;
	[strongAlert orderOut:self];
}];

I miss garbage collection.  None of that was necessary.  I still haven't got my head around dealing with this under ARC...

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: ARC query
      • From: Mike Abdullah <email@hidden>
References: 
 >ARC query (From: Jonathan Mitchell <email@hidden>)
 >Re: ARC query (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Request for guidance re. CALayer
  • Next by Date: Re: ARC query
  • Previous by thread: Re: ARC query
  • Next by thread: Re: ARC query
  • Index(es):
    • Date
    • Thread