为什么我在 xcode 控制台中收到此 CPSqliteStatementPerform 错误
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该设备似乎认为您正在尝试写入这些位置。我正在做一个类似的项目,并在 Organizer 中打开 iPhone 的控制台来查看发生了什么。
以下是当我尝试获取 MPMediaItems 的属性时显示的行:
尽管我只是检查值是什么,但它认为我正在尝试在那里写入。可能的错误?
编辑:
这是一个错误,正如此处讨论的那样 --->> 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:
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
当我开始使用 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.