Preloading plist not working

I was doing same thing for 2.x and was working but not in 3.2

In my splash screen i am prefeching plist by below line
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("ui.plist");

Now inside game when i am creating sprite getting assert fail error
Sprite *ss = Sprite::createWithSpriteFrameName("pause.png");

Assert failed: Invalid spriteFrameName: pause.png

also when splash screen left, i am getting below line in console

cocos2d: TextureCache: removing unused texture: D:/cocos2dx/projects/ABCD/Resources/mid/ui.png

what am i doing wrong?

No one has problem with preloading plist in 3.x??

I also have this problem with 3.6

Can you provide your ui.plist file?

Mine problem was solved on that time by removing below line from my controller class

CCDirector::sharedDirector()->purgeCachedData();

@festival hope this will help you. In 3.x it will remove spritesheets from cache memory.

@smitpatel88 Thanks.