Are there no outlet collections for mac applications? - macos

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

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.

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.

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

Related

Can I on Xcode 4.6 have Interface Builder in separate app?

I know this is a stupid question, but I want to be sure. I want the old one. I have Mountain Lion.
To answer your question as fully as possible: no.
Moving on, the direction Apple has chosen to follow involves merging the previously distinct NIB editing aspects of things into the rest of the IDE, which makes quite a bit of sense - especially as you can directly create outlets, etc. by dragging from the relevant control to the header file when using the assistant view.
If it's any consolation, you'll get used to it pretty quickly.

Recreating "ABPeoplePicker" functionality on Mac

I'm trying to create a Mac version of an iPhone app, and specifically I need to be able to pick a person from the user's Address Book, akin to the ABPeoplePicker on iOS. The look of the interface isn't particularly important (be it a separate popup window or a subview etc), I just need to pull up a list from Address Book and have the user select a row, and then feed the First and Last names from that contact back into my code.
But from what I can tell, that functionality doesn't exist for Mac, or else it isn't nearly as user-friendly and intuitive to implement.
Can anyone shed any light on how I might do this? Are there built-in functions I haven't found yet, or any good 3rd party code sources you can recommend?
PS I know enough to be dangerous, but I'm still very much a beginner. Code samples and tutorial links are very much appreciated!
Perhaps Apple's CocoaPeoplePicker demo can help you.
Here's the AddressBook framework reference

Does not using Interface Builder buy me anything?

I'm fairly new to Cocoa. I was talking to my brother, who's put together a few iPhone apps, and I said something about Interface Builder. He said that he doesn't use it - he builds his UIs programmatically. He said that this way, he doesn't have to worry about loading the NIB. I understand that using Interface Builder actually creates instances of view/window/button/etc objects that are serialized and have to be deserialized when you load the application, but is the deserialization that expensive? Granted, he's talking about iPhone and I'm developing on a MacBook Pro, but still.
I have yet to see an argument against using IB due to performance reasons, and having used both methods I havent seen any difference either way. For the more ui intense applications I usually end up not using IB only because it is difficult to build complex customized views with it. So really I tend to use IB for the more simple apps and go with the progammatic approach for the more complex apps. This approach obviously is performance optimizing as well.
Absolutely learn IB! It's worth it and will save you countless time over the long haul. Then use it when you can. When you cannot (high complexity) you always have the programatic approach but you'll find it FAR easier to maintain your nibs (IB) as your app grows and ages.
If both methods can be useful, I'd recommend going the Apple's way; i.e. using Interface Builder (IB). You'll get less code to write (and less code equals less bugs, less maintenance, less work ;) !), a better abstracted project, you'll be much more ready to inherit future goodies coming from Apple (remember Cocoa Bindingsā€¦), and soon you'll also be more productive.
Understanding what IB's doing for you (by going through your brother's method) is a very valuable knowledge too; so if you can do both on some li'l projects, do that. (As others said, for complex UIs, this will allow you to bypass it at times.) But still, in the end, I'd recommend using IB.
Although Interface Builder is an old piece of software, with its roots in NeXTSTEP development, it is still (IMO) an elegant way of creating the visual aspects of software.
In this interview with Aaron Hillegass, he says that "Experienced Cocoa programmers put a lot of the smarts of their application in the NIB file. As a result, their project has a lot less code."
And as we all know: "Less source code is better"
It depends a lot on the kind of application. ERP systems with a few hundred/thousand pages are not build with Interface Builder, as far as I'm aware.

What are the IB objects used in Mac OS X's Address Book?

Does anyone know what are the types of UI objects used in Mac Address book to edit the address components? I have started my first Cocoa application and in many instances I would like to have this look and feel as opposed to simple table views.
It's all entirely custom view code involving NSPopUpButtons and NSButtons and NSTextFields. While you may not be able to get it for free in Interface Builder, it shouldn't be especially difficult to build from scratch.

Building an application with "drawer" in Linux/Mac/Windows

I'd like to build an application with a "drawer" GUI element, like it is all over the place in Mac OS X.
Is it possible to do so in Linux/Windows? Is it possible to build it crossplatform?
I like OS X drawers, but they are not used nearly as often as they used to be. The only apps that I currently use that makes use of them are OmniWeb and TextMate.
I don't think it's worth trying to recreate that UI feature for Windows or Linux. In addition to being too much work, your users likely will find it jarring.
Generally speaking, a standard sidebar ought to support whatever you might use a drawer for.
I think you'd have to roll your own drawer in Linux/Windows.
You all say that drawer is not in use "anymore", which doesn't really help. In any case, I see it fit on a TextMate perfectly, and noone complains about it :-)
KDE seems to have a drawers-like functionality as seen in KDevelop, and some other applications (Kate, the editor, uses them too), but I have never tried to use them in anything I've written, and so would have no idea how to write them.
I haven't used Osx a lot, but cant just a normal sidebar do the job?
Drawers are no long really used on the Mac. I only know of a few that still use them and most of these are older applications. Most have moved the sidebar into the app in a collapsable split view.

Resources