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 9144975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:24:00+00:00 2026-06-17T10:24:00+00:00

I have a UITableView with a data source of NewsItem objects that is stored

  • 0

I have a UITableView with a data source of NewsItem objects that is stored in an array. In my NewsItem object I have a BOOL called ‘imageState’ that I wanted to be tracked. I wanted to use KVO such that when the value of this imageState changed then the UIViewController that has the NewsItem array be notified and it would then do some stuff (i.e: reloading the cells or something). How do I do something like this? Is it first of all doable?

  • 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-06-17T10:24:01+00:00Added an answer on June 17, 2026 at 10:24 am

    you can add the observer in the TableViewController , like this

    [self addObserver:newsItemObject  forKeyPath:@"imageState" options:(NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld) context:nil];
    

    it will observering the object , and when it change it will call this method , you should implement this method below:

    - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
    {
     NSLog(@"%@ \n %@ \n %@ \n ",keyPath,object,change);
     // do your things
    }
    

    if class NewsItem is your class , I think it is better use Delegate or Notification . The KVO is not a better way .

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

Sidebar

Related Questions

Setup: I have a UICollectionView or UITableView that’s backed by a simple array data
I have a UITableView whose data source is an NSMutableArray. The array contains NSMutableDictionaries
Suppose I have a UITableView with two sections. If the data source for that
I have a rather complex data source for my UITableView. I am very carefully
I have a core data UITableView, the core data managed object has 4 properties
I have a UITableView that displays some data that is read in at runtime
I have a UITableView that is being populated by core data. Now, when I
So I have a subclassed UITableView that lists data. I need to make only
How do I have a UITableView be notified that the data it is using
I have a UITableView whose data source and delegate are switched between a couple

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.