Domanda

In my project I have two files Products.h and .m. If I build project and run, I dont get any warnings & errors.

But when I run tests. I catch an error on this piece of source code:

NSArray* fetchItem(NSString* entity, NSSortDescriptor* sortDescriptor = nil);

The error message:

"Clang does not support default params".

Ok, I know, it may be a problem due to the architecture of the project.

I change the architecture in UnitTest as MainProject from $(ARCHS_STANDART_32BIT) to $(ARCHS_UNIVERSAL_IPHONEOS). And all the same catch error

"Expected ';' ',' or ')' before '=' token.

In both projects ARC is off.

So essentially, my question is, "How to enable default params on UnitTest projects?" Thank you very much,

È stato utile?

Soluzione

In your code line pls check if u r missing assignment

NSArray* fetchItem = (NSString* entity, NSSortDescriptor* sortDescriptor = nil);

I dont know what you want, coz after assignment that line is not making me any sense.

Altri suggerimenti

I found answer. Use default parameters bad syntax and not usage in Objective-C, I remove default param and problem solved.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top