7

Possible Duplicate:
Dependency injection framework for Cocoa?

Is there any IoC container for Objective-C?

Community
  • 1
  • 1
Vitek
  • 628
  • 3
  • 8
  • 15
  • 1
    I’ve already added several comments and subsequently deleted them, because I am not sure I understand IoC enough :) But let us try. What exactly are you trying to accomplish? Could you expand your question a bit? Objective-C is not Java and some things can be solved in a different way. – zoul Sep 26 '09 at 18:08
  • I'm looking for IoC container like Spring. I would like to avoid creating singletons, factories etc on my own...;-) – Vitek Sep 27 '09 at 06:50
  • 1
    Hmmm... I come from .NET land and make heavy use of IoC contrainers (specifically StructureMap). I stumbled across this question wondering if it would be possible to use a container in ObjC... Perhaps Objective-C is too low-level to support the amount of reflection and code generation required to implement a container??? – Charles Feb 05 '10 at 22:52
  • I don't mean to answer your question with an admonishment, but Cocoa programmers seem to get along fine without factories, singletons, etc.. – David M. Sep 13 '10 at 18:19
  • 2
    @David M.: _without_ singletons? Show me a Cocoa app that doesn't use `NSApplication`. –  Oct 20 '10 at 10:47
  • @Charles: ObjC is actually _more_ reflective than Java (I don't know enough C# to compare), so it would be super-easy to make an IoC framework using introspection and KVC. Interface Builder is really creating IoC containers, though it's obviously used in limited contexts. –  Oct 20 '10 at 10:51
  • 1
    @Graham Lee - It sure was super easy. Took me ~ 10 days. See here: https://github.com/jasperblues/spring-objective-c – Jasper Blues Jan 08 '13 at 02:04

3 Answers3

2

What about the Objective IOC dependecy injection framework?

zoul
  • 102,279
  • 44
  • 260
  • 354
1

What about using Interface Builder?

Le Hibou
  • 27
  • 3
  • That was my first thought. Though something with a human-editable persistent format would be beneficial (and let's face it, even XIB isn't comprehensible). –  Oct 20 '10 at 10:51
0

Very very simple IOC container here - Inverter

Aran Mulholland
  • 23,555
  • 29
  • 141
  • 228