HePing

Results 19 comments of HePing

@humt0ng As apple's example code shows, it may be unnecessary. https://developer.apple.com/documentation/foundation/nsinvocation/1437832-getreturnvalue?language=objc When the return value is an object, pass a pointer to the variable (or memory) into which the object...

@RylanJIN I think both is OK. It only differs when you put BeHive in an independent bundle, maybe, a framework. the apple's doc about `bundleForClass:` said below: ``` The NSBundle...

@RylanJIN One thing I have to say, If your framework is not dynamic, your class will be linked into the executable image. So it will be loaded from main bundle...

@codesourse This is my raw and dump idea: Make a wrapper class, and use composite pattern to wrap `BHConfig` class inside it. Then just make the wrapper class Multithreaded safe....

@xilin 我想解决你说的问题可以分为三部: 1、给ServiceManager增加类似于createService:configuration:的方法,使调用环境可以传递给ServiceManager对应的Servive初始化环境context; 2、给ServiceProtocol基础协议增加类似于setupWithContext:的方法,由createService:configuration:完成Service实例化之后,测试Service是否支持context条件初始化方法,如果支持协议方法,调用setupWithContext:,把外部调用的context传递给Service的协议方法。 3、具体实现Service协议接口的实体类,如果支持初始化参数,则实现setupWithContext:方法,接受参数context,并且按照context进行条件初始化。 @SoXeon 你们会接受这样的PR吗?我觉得我可以补充一下这个功能,然后PR。 :)

@JessieHu 在提问前先搞清楚,你问的东西是什么。xib是不能被调用的,它是一种静态文件格式。类似于Android的layout xml,属于静态的界面文件。当代码执行时,通过NSBundle,xib会被加载到内存中,initWithNib,然后初始化,awakeFromNib,然后就是内存对象了。如果你要修改xib中的东西,你完全可以在运行时修改,为什么要对一个静态文件如此痴迷。最重要的是,你所说的调用xib这种事情,是不存在的,解释完毕。

@RylanJIN When you use ServiceManager to create a Service instance, you finally get the instance from the return value, every time, a different instance. So, obviously you should take control...

@RylanJIN Let's think about this , If you want to maintain the block for after use, first your ShopModuleService instance maybe, should copy the block and save as a property....

@RylanJIN read this code from `BHServiceManager.m` carefully: ```objc - (id)createService:(Protocol *)service { id implInstance = nil; if (![self checkValidService:service]) { if (self.enableException) { @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:[NSString stringWithFormat:@"%@ protocol does...

@RylanJIN There's a neat way, but in high risk. you can make your block refer your returned service instance. Here is a retain cycle: your service instance retains your block,...