为什么我在 xcode 控制台中收到此 CPSqliteStatementPerform 错误

发布于 2024-11-06 05:54:51 字数 1019 浏览 0 评论 0原文

我在 xcode 控制台中收到以下错误,但我不知道它抱怨什么只读数据库:

CPSqliteStatementPerform: attempt to write a readonly database for UPDATE ddd.ext_container SET orig_date_modified = (SELECT date_modified FROM container WHERE pid=container_pid) WHERE orig_date_modified=0
CPSqliteStatementReset: attempt to write a readonly database for UPDATE ddd.ext_container SET orig_date_modified = (SELECT date_modified FROM container WHERE pid=container_pid) WHERE orig_date_modified=0

以下代码在错误之前执行:

MPMediaQuery *myPlaylistsQuery = [MPMediaQuery playlistsQuery];
NSArray *array = [myPlaylistsQuery collections];
playlists = [[NSMutableArray alloc] init];
[playlists addObject:@"new playlist"];
NSLog(@"%@", [playlists objectAtIndex:0]);

int numPlaylists = 1;
for (MPMediaPlaylist *arrayItem in array) {
    NSLog(@"Got here");

NSLog 打印“新播放列表”

然后 CPSqliteStatementPerform: 和CPSqliteStatementReset:初始化 for 循环后立即打印错误。

然后 NSLog 打印“到达这里”。

我正在编写什么只读数据库以及如何纠正这个问题?

I am getting the following errors in the xcode console, but I don't know what read only data base it is complaining about:

CPSqliteStatementPerform: attempt to write a readonly database for UPDATE ddd.ext_container SET orig_date_modified = (SELECT date_modified FROM container WHERE pid=container_pid) WHERE orig_date_modified=0
CPSqliteStatementReset: attempt to write a readonly database for UPDATE ddd.ext_container SET orig_date_modified = (SELECT date_modified FROM container WHERE pid=container_pid) WHERE orig_date_modified=0

The following code executes just prior to the error:

MPMediaQuery *myPlaylistsQuery = [MPMediaQuery playlistsQuery];
NSArray *array = [myPlaylistsQuery collections];
playlists = [[NSMutableArray alloc] init];
[playlists addObject:@"new playlist"];
NSLog(@"%@", [playlists objectAtIndex:0]);

int numPlaylists = 1;
for (MPMediaPlaylist *arrayItem in array) {
    NSLog(@"Got here");

The NSLog prints 'new playlist'

Then the CPSqliteStatementPerform: and the CPSqliteStatementReset: errors print immediately after the for loop is initialized.

Then NSLog prints 'Got here'.

What read-only database am I writing and how do I correct this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

愿得七秒忆 2024-11-13 05:54:51

该设备似乎认为您正在尝试写入这些位置。我正在做一个类似的项目,并在 Organizer 中打开 iPhone 的控制台来查看发生了什么。
以下是当我尝试获取 MPMediaItems 的属性时显示的行:

May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-mode /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/Library.itdb
May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-data /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/Library.itdb
May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-data /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/Dynamic.itdb
May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-data /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/Extras.itdb
May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-data /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/DBTemp/ddd.itdbm

尽管我只是检查值是什么,但它认为我正在尝试在那里写入。可能的错误?

编辑:
这是一个错误,正如此处讨论的那样 --->> https://devforums.apple.com/message/428584#428584

The device seems to think that you are trying to write to those locations. I am doing a similar project and opened up my iPhone's console in Organizer to see what was going on.
Here are the lines that show up when I try to get properties of MPMediaItems:

May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-mode /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/Library.itdb
May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-data /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/Library.itdb
May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-data /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/Dynamic.itdb
May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-data /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/Extras.itdb
May 27 22:11:04 unknown sandboxd[2512] <Notice>: QueryTesting(2510) deny file-write-data /private/var/mobile/Media/iTunes_Control/iTunes/iTunes Library.itlp/DBTemp/ddd.itdbm

Even though I'm just checking what the values are, it thinks I'm trying to write there. Possible bug?

EDIT:
This is a bug, as discussed here --->> https://devforums.apple.com/message/428584#428584

丑疤怪 2024-11-13 05:54:51

当我开始使用 Settings.bundle root.plist 文件时,这种情况开始发生在我的应用程序上。
当我删除它时它就会消失。

认为 NSUserDefaults.StandardUserDefaults 有问题......

现在我将忽略此消息,并将我的应用程序的更新发送给苹果。

This started happening to my app, when i started to use a Settings.bundle root.plist file.
When i remove this it disappears.

Think there is something wrong with NSUserDefaults.StandardUserDefaults.......

For now i'm just going to ignore this message, and send an update of my app to apple.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文