标签:blog http io os for sp 2014 on c
https://github.com/wangrenzhu/SimpleIoc-For-Objective-c
simple ios for objective-c 版 基本实现 所有功能 完美实现工厂 以及依赖注入。
// // ViewModelLocator.m // SimpleIoc // // Created by qvod on 14-9-25. // Copyright (c) 2014年 YF. All rights reserved. // #import "ViewModelLocator.h" @implementation ViewModelLocator - (instancetype)init { self = [super init]; if (self) { [[SimpleIoc defaultInstance] registerInstance:[SampleUIViewControl class]]; [[SimpleIoc defaultInstance] registerInstance:[MainViewModel class]]; [[SimpleIoc defaultInstance] registerInstance:[MainViewModel class] createInstanceImmediately:NO key:@"OtherMainView"]; [[SimpleIoc defaultInstance] registerInstance:@protocol(ITestServiceA) tClassName:[TestServiceA class]]; [[SimpleIoc defaultInstance] registerInstance:@protocol(ITestServiceB) tClassName:[TestServiceB class]]; [[SimpleIoc defaultInstance] registerInstance:@protocol(ITestServiceC) tClassName:[TestServiceC class]]; } return self; } @end
标签:blog http io os for sp 2014 on c
原文地址:http://blog.csdn.net/wangrenzhu2011/article/details/39642321