1
在我的項目,我用微距叫的keyPath從ReactiveCocoa:’意外」 @同時建立測試
NSString *lowercaseStringPath = @keypath(NSString.new, lowercaseString);
// => @"lowercaseString"
* @endcode
*
* ... the macro returns an \c NSString containing all but the first path
* component or argument (e.g., @"lowercaseString.UTF8String", @"version").
*
* In addition to simply creating a key path, this macro ensures that the key
* path is valid at compile-time (causing a syntax error if not), and supports
* refactoring, such that changing the name of the property will also update any
* uses of \@keypath.
*/
#define keypath(...) \
metamacro_if_eq(1, metamacro_argcount(__VA_ARGS__))(keypath1(__VA_ARGS__))(keypath2(__VA_ARGS__))
#define keypath1(PATH) \
(((void)(NO && ((void)PATH, NO)), strchr(# PATH, '.') + 1))
#define keypath2(OBJ, PATH) \
(((void)(NO && ((void)OBJ.PATH, NO)), # PATH))
它工作正常使用的主要對象。但是,當我嘗試運行測試,它表明我這個錯誤:
我看到this post
這是我的項目非常相似的問題。但仍然不同,並沒有有用的答案。 有沒有人有想法如何解決它?因爲我真的被困在這裏,不知道在哪裏移動。
測試目標中的'TokenModel'以及您的主要目標? –
是的,當然,我已經包括它。 –