0

Can I subscribe to be notified when a property getter is called, using ReactiveCocoa?

I need to set a flag that certain data needs to be updated (via network request) in the near future, because someone accessed it.

Dave Lee
  • 6,299
  • 1
  • 36
  • 36
Siarhei Fedartsou
  • 1,843
  • 6
  • 30
  • 44
  • @JoshCaswell I've updated the question based on a reply to my answer. Though I questioned why the OP would want to do it this way, the question itself was clear enough. – Dave Lee Apr 02 '14 at 06:22

1 Answers1

3

I don't know why you'd want to do this, I'd really suggest posting a question that asks what the best way to solve the problem you're seeking to solve. But, yes it's theoretically possible to do what you're asking, using -rac_signalForSelector:.

[[object rac_signalForSelector:@selector(property)] subscribeNext:^(id value) {
    // Getter has been called
}];
Dave Lee
  • 6,299
  • 1
  • 36
  • 36
  • I need to set flag, that some data needS to be updated(by network request) in near future, because someone accessed it. You answer seems to be right. Thanks! – Siarhei Fedartsou Apr 01 '14 at 21:05