Profile Image
3
Josephin DoeTyping . .
Profile Image
1
Lary Doeonline
Profile Image
Aliceonline
Profile Image
1
Alia10 min ago
Profile Image
Suzen15 min ago
Profile Image
3
Josephin DoeTyping . .
Profile Image
1
Lary Doeonline
Profile Image
Aliceonline
Profile Image
1
Alia10 min ago
Profile Image
Suzen15 min ago
Profile Image
3
Josephin DoeTyping . .
Profile Image
1
Lary Doeonline
Profile Image
Aliceonline

New Group

New Contact

Profile Image

Josephin Doei am not what happened . .

Profile Image
Lary DoeAvalable
Profile Image
Alicehear using Dasho
A
AliaAvalable
Profile Image
SuzenAvalable
JD
Josephin DoeDon't send me image
Profile Image
Lary Doenot send free msg
Desktop settings

You get latest content at a time when data will updated

Application settings

Automaticaly take backup as par schedule

System settings

Allow to show public user message

Josephin Doe
Profile Image

hello tell me something

about yourself?

8:20 a.m.

Ohh! very nice

8:22 a.m.

Profile Image
Profile Image

can you help me?

8:20 a.m.

Debug 模式下,通常不会对资源进行加密

文章详情

`FileUtils::getInstance()->setEncryptImage(true);` 会对图片资源启用加密功能。

在 Debug 模式下,通常不会对资源进行加密,但如果你设置了 `setEncryptImage(true);`,则引擎会期望图片资源是加密的。由于你在 Debug 模式下没有对图片资源进行加密,但却启用了这个选项,因此会导致图片资源无法正常加载,出现 `CCSpriteFrame must be non-NULL` 错误。

**解决方案:**

你可以在 Debug 模式下将 `setEncryptImage` 设置为 `false`,让引擎不对图片资源进行加密检查。可以使用条件编译或手动判断打包模式,像这样修改代码:

#if (CMAKE_BUILD_TYPE == Debug)
    FileUtils::getInstance()->setEncryptImage(false);
#else
    FileUtils::getInstance()->setEncryptImage(true);
#endif

或者手动在 `applicationDidFinishLaunching()` 函数中根据需要动态设置是否加密资源。

Tags:

发表评论