0

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,

ThomasW
  • 16,981
  • 4
  • 79
  • 106
Ilya Ilin
  • 2,283
  • 21
  • 27

2 Answers2

1

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

Ilya Ilin
  • 2,283
  • 21
  • 27
0

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.

hp iOS Coder
  • 3,230
  • 2
  • 23
  • 39
  • This declaration of method on C++. That not declare variable. I need just declare method and then implement him. – Ilya Ilin Apr 16 '12 at 08:32
  • exactly, i was sure that it isn't to declare variable. Thats why I wrote that 'it dont make me any sense'. Is that line to declare a method.? I'll see if I could help u to enable default params on UnitTest project? – hp iOS Coder Apr 16 '12 at 08:49
  • Yes, that string for method declare. – Ilya Ilin Apr 16 '12 at 09:05