4

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?

JeffB6688
  • 3,782
  • 5
  • 38
  • 58
  • Jeff, Did you ever find out what caused this. I have a similar problem and have not been able to find a solution. Bill – Progredux May 20 '11 at 15:16
  • No, I never figured it out. Still hoping that someone has a solution. – JeffB6688 May 25 '11 at 14:50
  • I was just thinking that maybe it throws an error when you put MPMediaItems into an array because you are trying to copy them? Thoughts? – Chris May 28 '11 at 03:17

2 Answers2

5

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

Chris
  • 11,819
  • 19
  • 91
  • 145
1

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.

Stephan
  • 2,356
  • 16
  • 38