Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 860097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:46:00+00:00 2026-05-15T08:46:00+00:00

I started learning Iphone development. As i’m reading about the cocoa development framework, few

  • 0

I started learning Iphone development.
As i’m reading about the cocoa development framework, few principal notions came around and with it a little bit of confusion.
I want to make sure I understand things right and to get a little clarification :

Delegate – basically the strategy design pattern. I set my class delegate and data source (which is also a delegate-like object) , and later on call methods on those delegate objects.

Notification – basically the observer design pattern, where the delegate is automatically registed to all the delegating object notifications.

Target/action – This it where i’m mostly confused.
There are the “SetAction”” and “SetTarget” methods for UI objects.
As I understand, if I connect a method using IB (by streching a line betweeen the UI object to the file owner), the method is the action and the file owner is the target.
Does it mean that all the UI methods’ (events) have to be directed to the same targer ? (As I only have SetTarget method which doesn’t accept a Selector or anything similar as another argument). The same question remains regarding actions. How can I stretch lines between many methods to one file owner if there is only one action (As the function SetAction imply) at a time.
I’m looking to understand how this mechanism works.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:46:00+00:00Added an answer on May 15, 2026 at 8:46 am

    Delegate – basically the strategy design pattern.

    I don’t agree. The Strategy pattern uses delegation but involves more than what Cocoa understands as delegation. If you have the Gang of Four book: it discusses delegation in the introduction (pp. 20-21). But I think you got it basically right: the delegating object calls methods on its delegate, either to inform it about something (a state change, an event) or to ask the delegate for data or if/how to proceed. The important thing is that delegate and delegating object are only loosely coupled: when implementing the delegating object, you don’t have to care about the delegate’s class.

    Target/action – This it where i’m mostly confused.

    Objects that have a setTarget: and setAction: method usually only have a single action/event (such as UIBarButtonItem, which only responds to one event: a single tap). Otherwise, the class should support setting different targets/actions for different events. See UIControl and its subclasses as an example. There, you assign target/action pairs with -addTarget:action:forControlEvents: and you are free to assign multiple targets for different events and also assign multiple targets for the same event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 541k
  • Answers 541k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Its a flexibility vs speed of development comparison. The forms… May 17, 2026 at 2:56 am
  • Editorial Team
    Editorial Team added an answer I used the notifications from NSManagedObjectContextObjectsDidChangeNotification May 17, 2026 at 2:56 am
  • Editorial Team
    Editorial Team added an answer I am not familiar with C# but I dare say… May 17, 2026 at 2:56 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm interested in learning Objective C for iPhone development. This is a topic which
I started learning Rails only a few days ago, but in the mean time
I've just started learning about thread safety. This is making me code a lot
I've started learning Objective-C a few weeks ago and I still don't understand how
Actually I don't care too much about Mac OS X development. I want to
After learning more about how monotouch works, I believe I know the answer to
I have search a lot for iPhone material to get started, but I found
I've recently started learning programming to make my own 3D OpenGL game on the
Just started learning C# (in xaml), so appreciate some elaboration: ((MSAvalon.Windows.Serialization.ILoaded)(_Text_2_)).DeferLoad(); Not sure what
Just started learning to use the grid so please excuse me for the possibly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.