草庐IT

XCTAssertTrue

全部标签

ios - 为什么将 NSString 对象传递给 XCTAssertTrue 的 "format"参数会导致构建错误?

在尝试使用XCTest测试我的应用程序时,我在执行以下操作时遇到构建错误:#import@interfaceMyTests:XCTestCase@end@implementationMyTests-(void)testExample{NSString*str=@"foo";XCTAssertTrue(YES,str);//Parseissue:Expected')'}@end但如果我这样做,我不会得到构建错误:#import@interfaceMyTests:XCTestCase@end@implementationMyTests-(void)testExample{XCTAssert