Objective-C Unit Tests cannot find my resources -
when run unit tests fails on loading external resources (images) same error if don't exist. in xcode have added resources unit test target. don't know try next.
i using cocos2d framework, try load following code within unit test atlasspritemanager *at = [atlasspritemanager spritemanagerwithfile:@"player2.png" capacity:50];
it seems calls uiimage imagewithcontentsoffile
returns nil.
the actual code throws error looks like
image = [uiimage cgimage]; if(image == null) { [self release]; nslog(@"image null"); return nil; }
it seems images required not copied on application support directory before unit tests run, after successful pass. not sure if problem, if is there way change build order images copied first , unit tests can find them?
the resources aren't getting included target. before have run script phase of test bundle, make sure have "copy resources" phase copies resources test bundle tests need.
Comments
Post a Comment