Adding Custom Objects in Xcode 4.3 - xcode

I'm working with Objective-C and Xcode for about a year. I customise a lot of generic objects. Few days ago one of my friend asked me a question, but I couldn't answer him. So I try to do something my self. For example:
I created this Custom View:
How can I add this View to the Object Library?. Here:
I don't really know why do I need this. But I decide to figure out how to do this. I hope you could help me with this.
Thanks in advance!

I don't think this will work. You are putting buttons on "top" of a custom view placeholder. The custom view placeholder is used to be able to use - yeah you guessed right - custom user defined views.
So of which class would your view-with-5-buttons-on-top be? I think you are running into a dead end, because that's just not the way to do it in Xcode. If you want to design your custom view graphically, just create a NIB file for it.
I don't think that you can add your own view objects into the object library. Everything I know of are user-defined code snippets which will show up on the right.
Edit
There were things called IB plugins in Interface Builder and Xcode versions prior to 4.
Those were discontinued in Xcode 4 as can be read here for example :
http://xcodebook.com/2011/03/no-interface-builder-plugin-support-in-xcode-4/
Further searches for IB plugin gives a lot more guys telling the same.
Best,
Flo

Related

Swift 3 Xcode 8: CoreData self.managedObjectContext.hasChanges returns false

I've been following this guide.
And I ported it to my code, I have the folders being made in my library folder, the file contained is a size of "0 Bytes". Inside my tableView I am able to click and add/delete items. So it does have a connection to CoreData. However when I wish to save the results of the tableview, it steps right over the line. I put a breakpoint in and cannot see the variable (nor what I'm supposed to be looking for).
I've been trying for two days to tackle this now. I've read up on google, was using these as a reference, and still no luck. My code and bindings matches up with the sample code provided.
Reference
any ideas? things to check that I haven't already done? It does seem like a link "disappeared" but everything is all on the same viewcontroller which is what is confusing me.
Figured it out. Right Click under delegate and the saveAction will be visible. Link it to your button. Voila! nOOb mistake. Learning here!

Make a Quick Look NSView in Swift

I'm trying to add this feature to my app: when pushing a certain button, open a quick look view of a certain file.
I saw this:
Use Quick Look inside a Swift cocoa application to preview audio files,
but the error written in the comments shows up and the app crashes after trying to go back and forth between files.
Apple's class reference of QLPreviewPanel is quite empty.
Which is a correct implementation? What is wrong in the answer in the question I linked?
Apple's class reference of QLPreviewPanel is quite empty.
They have a lot of bugs currently. You can "View page source" in your browser, or use Xcode built-in help, it's pretty good.
Which is a correct implementation?
It looks like someone has already done it with Swift. I'm not sure if that's the full implementation.
What is wrong in the answer in the question I linked?
QLError() [...] called while the panel has no controller is decrypted this way: some class in the responder chain (your NSView or NSWindow should be there already, unless you have a very complex structure) must respond to acceptsPreviewPanelControl: and two other QLPreviewPanelController methods.

MVVMCross How does this View get linked to the ViewModel?

I'm trying to figure out why I get an error message about not being able to find the right ViewModel when I'm running my iOS app.
The question I have is when I look at this example I don't understand where MainMenuView gets bound to MainMenuViewModel.
Can someone answer this for me?
Thanks,
PkL728
They are bound by class names: for XXXView should be corresponded XXXViewModel
Just want to add to the answer: double-check the names of the views after renaming (even Resharper renaming is not perfect). Spent several dozens of minutes (and a beer can), catching similar MvvmCross's error Could not find view for %ViewModelName%.
I'm getting this on a project that I've just upgraded to MvvmCross 4. I don't have much experience with MvvmCross, and the project hasn't been maintained for a few years, so it's possible something else is wrong.
I ended up hard coding the mappings in Setup::InitializeViewLookup because I don't have time to waste on it anymore.
For anyone who ends up here having the same problem I had. I was getting this error in an Android project because my (properly named) view was extending Activity and not MvxActivity (happens easily when you use Xamarin Studio's "Add Android Activity" feature)

How to use Xcode Utility view?

Sorry for such a basic question.
After using MS Visual Studio for 15 years, I recently moved to Apple and its Xcode. So I am really newbie in this new tool. I can work with some very basic parts of utilities as Referencing outlets or such stuff, but there are a lot of other stuff there that I had never seen in Visual Studio (as file owner, accessibility reference, ...)
I am looking for a good tutorial on that. Any one knows any? Any suggestions will be appreciated.
Apple has very helpful documentation about their technologies: OSX and iOS
The best place to start using Xcode is Xcode 4 User Guide and Xcode Quick Start Guide
This is something like Properties menu in VS. the only difference is that you can simply change to Assistant editor and hold control+drag from each one directly to your code.
Remember this is based on MVC ( Model= data, View= what you see and Controller)
In fact view and model are almost separated and controller is the connector between them:
this may help in the picture above: everything is counted based on Controller: OUT-let can remind you OUT of controller: I mean commands from controller to something. and sender means what sends messages TO the controller. These will make codes just like delegate coding in Visual Studio when you drag and drop an object to the window and double click on them. The (id)sender is counterpart of (void)sender in VS.
watch the Stanford iOS class on iTunesU. It is very good and if you know programming it will be very fast. Make sure you watch the fall 2011 version, it is about iOS5 and xcode4.

Cocoa Interface Builder's 'Attributes Inspector' like window

I'm making a Cocoa application, and I would like a panel like the 'Attributes Inspector' in Interface Builder. So with big tabs on the top and collapsable/expandable groups. Does anyone know how I can do this?
This is an image of the Attributes Inspector:
Attributes Inspector http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeQuickTour/Art/hello_win_attributes.jpg
So I actually want to make a window like the one shown in the image above.
InspectorKit is FOSS on github.
There's no built-in Cocoa controls to do this. You're going to have to write some custom views which replicate the functionality.
There some good advice for creating custom controls in the answers to this question: Looking for info on custom drawing of interface components (Cocoa)
If you need additional help, I recommend you ask smaller, more specific questions explaining what you've tried and what hasn't worked.
I've written some custom classes to do this- it ended up being less work than I expected. I broke it down into two separate components which can be used independently- the first handles the icons at the top and performs the view switching and the second handles the expandable panes:
My code is available at github and is under the BSD 2-clause license.

Resources