What is the difference between retain & assign in iOS operating system?



What is the difference between retain & assign in iOS operating system?..

Answer / Priyanka Pethe

In Objective-C, the 'retain' message increases the retain count of an object by 1, meaning that you are telling the object to hold on to its memory a little longer. The 'assign' message simply sets a new value for an object without increasing or decreasing its retain count. It is used with primitive types like NSNumber and NSString.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Interview Questions

Functionality of accelerometer of an iphone

1 Answers  


how you can delete a smart group created in Xcode?

1 Answers  


What is nslayoutanchor?

1 Answers  


Explain xctest test case code.

1 Answers  


What are some common execution states in ios?

1 Answers  


Difference between iOS 3 , iOS4, iOS 5, iOS 6, iOS 7 and iOS 8 (What are the new features)

1 Answers  


What is iphone sdk?

1 Answers  


How can a user respond or react to the state transitions on the app?

1 Answers  


What are the Common reasons for app rejection from app store review process?

1 Answers  


What language is ios written?

1 Answers  


What is plist file and explain about it is usage in iOS operating system?

1 Answers   UGC Corporation,


What are the different types of ios application states?

1 Answers  


Categories