Ich bekomme Kompilierungsfehler überall wo NSParameterAssert verwendet wird. Zum Beispiel:Kompilierungsfehler mit NSParameterAssert mit Xcode 6.3
-(instancetype)initForPlot:(CPTPlot *)plot withFunction:(CPTDataSourceFunction)function
{
NSParameterAssert([plot isKindOfClass:[CPTScatterPlot class]]);
NSParameterAssert(function);
if ((self = [self initForPlot:plot])) {
dataSourceFunction = function;
}
return self;
}
Der Code kompiliert mit Xcode 6.2 in Ordnung, aber es gibt mir die folgenden Fehler mit Xcode 6.3:
/Users/xxxx/Project/App/Presentation/CorePlot/Source/CPTFunctionDataSource.m:110:5: Using %s directive in NSString which is being passed as a formatting argument to the formatting method
Ich habe Online-nachgeschlagen und haben keine Informationen über die Fehlermeldung zu sehen.
Ein temporärer Fix ich verwende ist die folgende:
#undef NSParameterAssert
#define NSParameterAssert(condition) ({\
do {\
_Pragma("clang diagnostic push")\
_Pragma("clang diagnostic ignored \"-Wcstring-format-directive\"")\
NSAssert((condition), @"Invalid parameter not satisfying: %s", #condition);\
_Pragma("clang diagnostic pop")\
} while(0);\
})
Es sollte jedoch eine bessere Lösung für diese sein.
Das gleiche Problem nach dem Upgrade Xcode. –
Das gleiche gilt auch hier. – UberJason
Keine wirkliche Lösung, aber ich habe daran gearbeitet, indem ich -WNO-cstring-format-Direktive zu WARNING_CFLAGS hinzugefügt habe –