Safari Web Inspector-esque functionality in Xcode? - xcode

Just starting out in Objective-C, so I'm curious as to how some apps that I enjoy function interface-wise. I've cloned a few apps from Github into Xcode, and I'm looking for something similar to Safari's Web Inspector where I can highlight portions of the application and see what piece of code they refer to?
I think it may have something to do with Interface Builder, but I'm not sure where to begin... help?
Thanks!

This doesn't exist AFAIK. Interface Builder doesn't show a representation of your code, it allows to you to lay out (serialized) interface elements to your app graphically.

Related

Develop an iPhoto-like cocoa app for mac OSX

I plan to develop a mac OSX app that has a UI similar to that of iPhoto - a panel on the left and a grid view of images on the right. I am thinking of using NSSplitView to create two panels and using NSCollectionView for the grid.
I guess this must be a pretty popular and common UI pattern for mac apps. I am new to cocoa development. Can anyone with previous experience point me to any related cocoa code samples and design document?
Thanks a lot in advance.
N.B.
This missing piece here is an NSOutlineView in source list mode, put that in your left pane. But otherwise seems like a good place to start.
You might also be interested to see what the developer of Sonora approached this problem; although this is a music app the layout is almost the same.

Connecting interface builder to the code in Xcode 4

I created a new project in Xcode 4 using the "Cocoa Application" template and added a few UI elements as seen below:
Now that I've designed this basic interface I'm at a loss for how to actually respond to user events for that button. What type of class should I create and how do I connect that class to IB?
I realize I could read the 100s of pages of Apple documentation that explains all this, but those tend to be too verbose and slightly overwhelming. Thanks for your guidance!
You Ctrl+Drag connections from your controls to actions (defined in code) of the other objects in your XIB file. Cocoa is a powerful framework and Xcode is a wonderful tool, but you're going to have to do some reading to get started. Here's a good site for beginners: Cocoa Dev Central. I recommend you study the tutorials in this order:
Learn Objective-C
Learn Cocoa
Learn Cocoa II
Objective-C Style I
Objective-C Style II
Then you can do some of the more advanced ones. The tutorials are designed for Xcode 3, but they should not be hard to follow, and it you run into problems, Google is your friend.
Control drag from each UI element to the assistant editor.
If you select outlet then it will generate the property and the ivar along with the proper memory management in the .m.
If you select action then it will create a method that will be called when your UI element is interacted with.
I would post a decent picture but I do not have enough reputation...

How to make something like Twitter for Mac top bar or GitHub's one?

I'm making an app and seen that twitter has this style for navigating through views (like iOS UINavigationController):
Is there any control that emulates that behavior?
Take a look PXNavigationBar, it features this kind of breadcrumb navigation bar.
However, about this specific type of control, I might be wrong, but I think this is part of the Chameleon project (used by the GitHub for Mac app) and/or TwUI (Twitter for Mac UI).

Graph view like iAd producer

Is there a way to use the same tree graph component as Apple uses for iAd producer? An equivalent would be fine, but if it's already in the cocoa framework, can somebody point to the specific component?
There's a framework for iPhone and Mac called Core Plot, available on Google Code. However, if you're looking to put graphs in the iAd itself, you'd need to find a Javascript-based framework.
Ah, you're looking for a visual layout control. Sorry, the only thing I know of like that is "EFLaceView", but there's no reliable download link to it anywhere. If you google it, you might find it. EFLaceView is a bit different from what's shown in the screenshot (it's more like what you see in Quartz Composer), but it's pretty similar.
Edit: Aha, there's a link to it here: any Cocoa control code that I can use that acts as a patch bay?

How do I embed a web browser into my Cocoa application?

I need to learn how to add a web browser into a cocoa application. (Mac)
Try WebKit. In particular, you might find the MiniBrowser example that comes with the developer tools interesting. It should be at /Developer/Examples/WebKit/MiniBrowser.
It's not very difficult:
1) add a WebView object to your interface builder project.
2) (this is the important part) be sure to implement the required delegate methods and set your implementing class as the WebView delegate (in IB). I don't recall exactly, but I think there are like 6 methods you need to implement in your delegate... then it will just work.
(of course, check the example code...)

Resources