Powered by
Powered by
HuntMyIdeas-Inspire You To Make It Happen
Follow
   Me
  • Blogs
  • About Me
  • Home

Top  Interview Questions And Answers in Objective C

12/16/2014

1 Comment

 
Picture
1.What is IBOutlet in iOS?
Answer:

IBOutlet is a macro defined to denote variables and methods that can be referred to in Interface Builder.

IBOutlets are used to hook up your interface made in Interface Builder with your controller
IBOutlet resolves to nothing, but they signify to Xcode and Interface builder that these variables and methods can be used in Interface builder to link UI elements to your code.
​
-An IBOutlet is for hooking up a property to a view when designing your XIB.
-An IBOutlet lets you reference the view from your controller code.
Read:
iOS Interview Questions And Answers Part 10  
iOS Interview Questions And Answers Part12

2.What is IBAction in iOS?
Answer:-

-IBAction is a macro defined to denote variables and methods that can be referred to in Interface Builder.

-If you're not going to be using Interface Builder at all, then you don't need it in your code, but if you are going to use it, then you need to specify IBAction for methods that will be used in IB.

-IBAction is used to hook up your interface made in Interface Builder with your controller.

-IBAction is a special method triggered by user-interface objects. Interface Builder recognizes
them. An IBAction is for hooking a method (action) up to a view when designing your XIB.

-IBAction resolves to void .

- An IBAction is for hooking a method (action) up to a view when designing your XIB.

. An IBAction lets the view call a method in your controller code when the user interacts with the view.


Read:
Basic iOS interview Questions And Answers 
Top 5 Frequently Asked iOS Interview Questions And Answers.

3.Should IBOutlets be strong or weak under ARC?
Answer:-

Instance variables under ARC are strong by default.
General rule of thumb, anything with an IBOutlet should be declared as weak.

According to rule of thumb:
When a parent has a reference to a child object, you should use a strong reference. When a child has a reference to its parent object, you should use a weak reference or a unsafe_unretained one (if the former is not available).


Read:
Best Tutorials- Properties in objective C

4.What is Strong in objective-c?
Answer:-

Strong
A strong reference (which you will use in most cases) means that you want to "own" the object you are referencing with this property/variable.

The compiler will take care that any object that you assign to this property will not be destroyed as long as you (or any other object) points to it with a strong reference.

Only once you set the property to nil will the object get destroyed (unless one or more other objects also hold a strong reference to it)


Read:
Why properties are  made nonatomic in Objective C?
iOS Interview Questions And Answers Part 13

5.What is Weak in Objective-c?
Answer:

A weak reference you signify that you don't want to have control over the object's lifetime. The object you are referencing weakly only lives on because at least one other object holds a strong reference to it.

Once that is no longer the case, the object gets destroyed and your weak property will automatically get set to nil.

Example:-
Delegate properties, which are often referenced weakly to avoid retain cycles, and
subviews/controls of a view controller's main view because those views are already strongly held by the main view.


Read:
Top iOS Interview Questions And Answers for Beginners
iOS Interview Questions with Answers part4
iOS Interview Questions And Answers part12
1 Comment
Eric
6/2/2015 05:20:48 am

IBOutlet is a macro defined to denote variables and methods that can be referred to in Interface Builder.

This is correct for variables/properties, however the macro for methods is IBAction.

Reply

Your comment will be posted after it is approved.


Leave a Reply.

    Enter your email address:

    Delivered by FeedBurner

    RSS Feed

    Archives

    December 2019
    August 2018
    January 2018
    December 2017
    November 2017
    October 2017
    August 2017
    April 2017
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014


    ​​Categories

    All
    Affiliate Marketing
    Alexa Rank
    Apple's Latest Updates
    Blog Tips
    Cocos2d X
    Cocos2d-x
    Google AdSense Tips
    Grab-some-ultimate-ideas
    How-to-create-a-twinkling-star-background-effect-in-ios
    In-App Purchase Tutorial In Cocos2d-x (C++) Using SDKBOX
    Ios Interview Questions And Answers
    IOS Multiple Choice Questions And Answers
    Objective C
    Online Business
    Python
    Secrets To Effective IPhone App Marketing
    SEO Tips
    Swift Interview Questions
    Swift Tutorials
    Top 10 Articles Objective C
    Top 10 Articles-Objective-C
    Top 10 Popular Movies Ever
    Top 10 Popular Things To Know
    Top 10 Ultimate Issues Xcode
    Top 400 IOS Interview Questions
    Top IOS Sample Projects To Learn From
    Top Secrets To App Marketing
    UICollectionView
    Unity 3D
    Xcode

WELCOME TO HUNTMYIDEAS

Picture
I am Jitendra Gochhayat,an iOS Developer,Designer,blogger,
​from Odisha,India.
I write about ​​​blog tips and,
Make money online Tips,
​Objective C tutorials
SUSCRIBE TO NEWSLETTER

    Subscribe to this blog and receive notifications of new posts by email

Suscribe
Picture
Picture
Picture
Picture
Picture
HuntMyIdeas-2016 Powered By Weebly
Picture
Powered by Create your own unique website with customizable templates.
Powered by
Powered by