i used the code below in the levelManager.m
to read values from a plist but when I am making an Archive to upload to itunes (AppStore) I get an error. why ?
the code :
- (float)floatForProp:(NSString *)prop {
NSNumber * retval = (NSNumber *) [_curStage objectForKey:prop];
NSAssert (retval != nil, @"Couldn't find prop %@", prop);
return retval.floatValue;
}
the error:
NSAssert undeclared first use
Note I notice that xcode is thinking that I am giving NSAssert 3 parameters instead of 2
You could use one of the NSAssert
variants, in your case NSAssert1
:
#define NSAssert1(condition, desc, arg1)
So:
#import <Foundation/Foundation.h>
- (float)floatForProp:(NSString *)prop
{
NSNumber * retval = (NSNumber *) [_curStage objectForKey:prop];
NSAssert1 (retval != nil, @"Couldn't find prop %@", prop);
return retval.floatValue;
}
Related post of interest and Apple's Assertions and Logging Programming Guide.