Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
608 views
in Technique[技术] by (71.8m points)

objective c - Why am I getting this CPSqliteStatementPerform error in xcode console

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...