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

  • SEARCH
  • Home
  • 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 5985713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:34:11+00:00 2026-05-22T22:34:11+00:00

For instance, I have a model class which handles receiving bluetooth messages from other

  • 0

For instance, I have a model class which handles receiving bluetooth messages from other iPhones. When I receive one of these messages, I need to update a view. I believe the standard way of doing this is through the view controller. The view controller has a reference to the model and the view, and so can communicate to each of them.

However how should they send messages back to the VC? They could have a reference to the view controller each (as an property, with assign not retain). Is that bad practise (if I’m not mistaken its a circular reference)?
Are there alternate ways of doing this? I’ve considered the delegate pattern, but to write an entire delegate and all seems like quite a lot of work for a simple problem.
Alternatively, if you think I’m overthinking this, feel free to tell me!

[I think this question has probably come up before, it seems quite common, but I searched for a bit and didn’t find much]

Thanks for your help,

  • 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-22T22:34:12+00:00Added an answer on May 22, 2026 at 10:34 pm

    In general you have 3 different techniques:

    1. Delegation
    2. KVO (Key-Value Observing)
    3. Notifications

    If your model only needs to inform one object (your view controller) of changes, delegation is the way to go. It may feel like extra work to create a new interface, add the delegate property to the model, etc. but it is definitely worth it in terms of flexibility, code reuse, design, etc. Delegation is a standard pattern in Cocoa programming and is used extensively in Apple’s APIs.

    If your model needs to inform multiple objects of changes, you want to use KVO or notifications. With KVO you can subscribe to change events for a specific property or key on the model. For example, when the ‘messages’ property on your model changes, any attached listeners can be notified of the change and respond accordingly.

    Notifications are used when you want to send application-wide messages to multiple listeners. Examples from the standard APIs are keyboard notifications (when the keyboard is displayed/dismissed), and interface orientation changes.

    So in your case, delegation or KVO would probably the best choice.

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

Sidebar

Related Questions

I have an application which may only have one instance of itself open at
I have a complex django object, which has properties of other class types. This
I have a model class 'Market' which has many products: class Market < ActiveRecord::Base
I have an app where I want to link an instance of a model
I have an object instance which I access with the ME as it accesses
My question is how does one abstract a database connection from the model layer
I have the following model set up: class UserProfile(models.Model): Additional attributes for users. url
I have my own custom control derived from System.Windows.Forms.TreeView which is present on the
I have a model which contains a ManyToMany to User to keep track of
I have called a function from a class to find all the items related

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.