Objective-C and designing a plugin mechanism - objective-c

I need to design a simple plugin system in Objective C. I would like some advice about how to go about this. Thanks!

Cocoa is your girlfriend: http://www.cimgf.com/2008/09/17/cocoa-tutorial-adding-plugins-to-a-cocoa-application/
Awesome tutorial.

There is always going to the Source. Here is the ADC reference to Plug-ins

There are dozens of ways you could do this, so you might need to elaborate a little on what exactly you're trying to achieve. As a starting point, I'd recommend you look into Cocoa delegates which are usually a great way to integrate new code into an existing framework.

Related

How to create UI tags in Cocoa Objective-c?

I'm looking into building a tagging feature in my Mac app. I would like to do something like in the attached image. Is the UI portion offered natively in Cocoa? If so, what is the class name?
You can use NSTokenField to accomplish that. Start by reading Token Field Programming Guide.
I had to do exactly that a couple of weeks ago. I decided to use NSTokenField as well but ran into quite a number of problems. See my endeavours here. Hope you fare better with your implementation as it gave me a couple of really short nights....

making osx modal

I've used applescript a lot, and I love it. But for some workflows it would be really neat to be able to go into a "mode" where single keystrokes would allow me to launch scripts, choose options in dialogs, interact with apps etc. It's my impression that this is impossible with applescript alone but doable with objective-c. What are my options? What do I google to start reading up on this?
PS. If there are several options I'd prefer the ones that work best with applescript (or python).
I think the best way is learning AppleScriptObjC, You write an cocoa application with AppleScript syntax. Like Apple says, with AppleScriptObjC you can write first class applications in AppleScript. If you have no experience with cocoa it can be very time consuming job to use the right objects and it's methods. So before you think, like many others, that there is a huge lack of documentation, your answers can be found in the Cocoa-Objective-C documentations and examples. A good book for people who are familiar with AppleScript already is Shane Stanley's AppleScriptObjC explored, that can be found here http://www.macosxautomation.com/applescript/apps/index.html.
Because you know python as well you could use PyObjC as well but I don't have experience with it.

Are There Any Good Open-Source Mac Application Templates

I am looking to make a Mac version of one of my iPhone apps and was looking for a good ay to hit the ground running. I know how to code in Objective-c and Cocoa, and I know how to piece something together from scratch if I have to, but I am looking for an easier way.
Are there any open-source templates for coding Mac desktop applications that I might be able to pick up and use to get started off without reinventing the wheel?
EDIT:
I guess what I am looking for is an easy way to get started on an app that has the "iTunes Look and Feel". If there are some bare-bones version of this layout as some sort of template project, that would be great. Also, why has somebody down-voted this question? Have I asked something that is not appropriate for SO?
Apple includes lots of project templates with Xcode (vanilla application, document-based application, Core Data document-based application, etc.). I don't really know how much more you would want in a template. They're generally pretty good for getting you started, I think. If you're looking for something more than these offer out of a "template," maybe you could elaborate.
If you're just looking for a starting point for the interface, then check out BW Toolkit:
http://brandonwalkin.com/bwtoolkit/
He has some nice videos on his site showing how to create a Mail-like interface very quickly.
Besides the project templates included with Xcode, you should browse the application exmples in /Developer/Examples. Most of these examples are "full" applications that demonstrate one or more Cocoa-related concepts. Many could serve as the starting point for a similarly orriented app of your own.

Syntax coloring for Cocoa app

I'm planning to do a Cocoa app that requires code syntax to be colored (in all common languages). Instead of writing my own code highlighter/parser, are there any pre-made solutions available?
Thanks
You might be able to use something like Geshi, but there're also the resources listed here: http://www.cocoadev.com/index.pl?SyntaxHighlighting
Edit
More links:
Syntax Highlighting in Cocoa TextView? Experiences? Suggestions? Ideas?
http://parsekit.com/okudakit/
An excellent solution is Uli Kusterer's UKSyntaxColoredTextDocument. It is fast and has several built-in syntax parsers. It's easy to add new languages.
It's free for non-commercial use and very cheap if you want it for a commercial app.
You can also use the JavaScript library SyntaxHighlighter and embed it into a WebView into your app.
After quite a bit of research trying to solve a similar problem, the simplest approach I found by far is to use a JavaScript library for syntax highlighting combined with a WebView. Spending time writing a syntax highlighter, a fairly complex task, is probably not what you'd want to spend time on.
I settled on using the popular CodeMirror and wrote an open source wrapper for Cocoa: https://github.com/swisspol/CodeMirrorView. You can use similar approaches to wrap other JavaScript based code editors in Cocoa apps.
You can use highlight that is used in QLColorCode :) (however, it's not a Framework that you include in your code, but a command-line utility)
EDIT: Ah yeah, use Geshi, it's probably better :D

Lightweight, cross-platform input library

I'm trying to write a game with support for Joypads as well as mouse/keyboard. I've tried finding information about that, but it's either outdated or not portable enough.
Does anybody know of any good, lightweight libraries that can abstract Joypad reading? I want to use the 360 controller, but I would like support for more than that.
I'm primarily going to be writing on Windows, but I really don't want to use DirectInput/XInput, in case I ever wish to port my code.
Have you ever tryied OIS (Object Oriented Input System)? An efficient and light weight library.
I am very satisfied with it.
I have never tried with the 360 controller, but it should work fine.
This maybe an older question and is already answered but..
Someone on tigsource made a lightweight cross-platform gamepad library
that you might find useful.
You can view the post on it here.
What about SDL?
Maybe it's not what you mean by lightweight (it has the graphic and audio subsystems too), but it's very portable.
I know this thread is very old and by now you might have gotten what you need, but im answering this just in case someone stumbles on it and needs help as well.
I stumbled upon this library gainput and it seems like it makes alot of sense. You can try it out, if it helps.
Gainput is a lightweight c++ library, that enables you use the same interface for Joypads, macs, pc, linux as well as mobiles, and it is very easy to integrate to your project.
A link to gainput can be found here (http://gainput.johanneskuhlmann.de/)
Have you looked at XNA game framework?
There is also
Allero
http://www.talula.demon.co.uk/allegro/
GarageGames
http://www.garagegames.com/
Try that out