4

It seems that there is no way to use outlet collections in a mac application. Why not?

user
  • 85
  • 7

3 Answers3

0

Generally if there's a feature that you want on iOS or OS X frameworks and tools its best to raise a feature request on bugreport.apple.com.

Should enough people request that thing then maybe the engineering managers might pay attention ( or not )

But yes the other answer about Bindings is a good suggestion. Bindings are very cool and useful.

Warren Burton
  • 17,451
  • 3
  • 53
  • 73
  • I just looked through the documentation of bindings and I understand that they're useful to let values keep synchronized, but how does the solve my problem? I have 15 NSImageViews and want to keep them in one array to avoid many code. Can you give an example of how to realize that with bindings? – user Sep 08 '12 at 16:49
  • Sounds like you want each imageview to have its own unique image and bindings won't help you there. You would be better to use the tag value or even a custom subclass property to do this. – Warren Burton Sep 09 '12 at 08:26
0

Just put your image views into an array -- if they're all subviews of the same superview, you can loop through that super view (testing for the fact that they're NSImageViews or checking a tag value) and add them. This way also has the advantage that you don't need to create IBOutlets for them.

Whether bindings are appropriate for your problem depends on what you want to do with the image views. I would need more information to comment on that.

rdelmar
  • 103,982
  • 12
  • 207
  • 218
-1

A Mac Application makes use of BINDINGS, which is quite useful and doesn't exist in iOS SDK. You can achieve the same.

Read the Cocoa Bindings Programming Topics

Fab1n
  • 2,103
  • 18
  • 32