Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the "strong" keyword do

I downloaded the Xcode 4.2 developer preview version and I created a cocoa application. But I found a very weird syntax in the delegate class:

@property (strong) IBOutlet NSWindow *window;

What does this mean? And the compiler can't even compile it.

Thanks in advance!

like image 820
zs2020 Avatar asked Jul 07 '11 15:07

zs2020


People also ask

What does the strong tag do?

The <strong> HTML element indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type.

What does strong mean coding?

A strongly typed programming language is one in which each type of data, such as integers, characters, hexadecimals and packed decimals, is predefined as part of the programming language, and all constants or variables defined for a given program must be described with one of the data types.

What's the difference between B and strong?

b or i means you want the text to be rendered as bold or italics. strong or em means you want the text to be rendered in a way that the user understands as "important". The default is to render strong as bold and em as italics, but some other cultures might use a different mapping.


1 Answers

It indicates that this property is a strong relationship—an ownership. It's ARC's version of the retain keyword in the same context.

And the compiler can't even compile it.

It's valid ARC code, so if your tools support ARC, they certainly should be able to compile it.

Make sure that you're using Xcode 4.2 or later, and that you have the project's compiler choice set to Clang (“Apple LLVM Compiler”).

like image 78
Peter Hosey Avatar answered Oct 08 '22 23:10

Peter Hosey