Note that there are some explanatory texts on larger screens.

plurals
  1. POCryptic SQLite console output in Objective-C
    primarykey
    data
    text
    <p>When running my program to query the iPod library of my iPhone, I get the following output in the console:</p> <p>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</p> <p>I have disabled everything that outputs to the console so it isn't as if I am having an error with NSLog. What is going on here and how can I fix it. I'll include the overall class source code that I am calling, along with the class that does the work (sorry for posting it all:</p> <pre><code>+(NSMutableDictionary *) makeQuery { MPMediaQuery *query = [[MPMediaQuery alloc] init]; //query iPod library NSString *facebookIDKey = @"Facebook ID"; NSString *genericFacebookID = @"1234567890"; NSMutableDictionary *organizedSongData = [NSMutableDictionary dictionaryWithObject:genericFacebookID forKey:facebookIDKey]; NSArray *allSongs = [query collections]; //only add those songs which have not //been played since last login for (MPMediaItem *recent in allSongs) { NSDate *lastPlayed = [recent valueForProperty:MPMediaItemPropertyLastPlayedDate]; int songCounter = 1; BOOL uploadInfo = [[PlayedSinceLastLogin alloc] initWithLastPlayedDateOfSong:lastPlayed]; if (uploadInfo == YES) { //adds songs into [organizedSongData addEntriesFromDictionary: [MakeDicForSongInfo initWithMPMediaItem:recent andSongNumber:songCounter]]; songCounter++; } } return organizedSongData; } </code></pre> <p>Here is the actual brunt of the work, done in the MakeDicForSongInfo:</p> <pre><code>+(NSDictionary *) initWithMPMediaItem:(MPMediaItem *) song andSongNumber: (int)songCount{ //Create &amp; initialize NSStrings for keys //Create NSArray to hold keys NSString *songKey = [NSString stringWithFormat: @"%i Song Title", songCount]; NSString *albumKey = [NSString stringWithFormat: @"%i Album", songCount]; NSString *artistKey = [NSString stringWithFormat: @"%i Artist", songCount]; NSString *artistIDKey = [NSString stringWithFormat: @"%i Artist Persistent ID", songCount]; NSString *lastPlayedKey = [NSString stringWithFormat: @"%i Late Played Date", songCount]; NSString *genreKey = [NSString stringWithFormat: @"%i Genre", songCount]; NSString *ratingKey = [NSString stringWithFormat: @"%i User Rating", songCount]; NSString *playCountKey = [NSString stringWithFormat: @"%i Play Count", songCount]; NSArray *propertyKeys = [[NSArray alloc] initWithObjects:songKey, albumKey, artistKey, artistIDKey, lastPlayedKey, genreKey, ratingKey, playCountKey, nil]; //Create &amp; initialize NSStrings to hold song property information //Create NSArray to hold the values NSString *songTitle = [song valueForProperty:MPMediaItemPropertyTitle]; NSString *albumName = [song valueForProperty:MPMediaItemPropertyAlbumTitle]; NSString *artistName = [song valueForProperty:MPMediaItemPropertyArtist]; NSString *artistID = [song valueForProperty:MPMediaItemPropertyArtistPersistentID]; NSString *lastPlayed = [song valueForProperty:MPMediaItemPropertyLastPlayedDate]; NSString *genre = [song valueForProperty:MPMediaItemPropertyGenre]; NSString *userRating = [song valueForProperty:MPMediaItemPropertyRating]; NSString *playCount = [song valueForProperty:MPMediaItemPropertyPlayCount]; NSArray *propertyValues = [[NSArray alloc] initWithObjects:songTitle, albumName, artistName, artistID, lastPlayed, genre, userRating, playCount, nil]; //Create NSDictionary to store information, initializing it with //above data, then returning the resulting dictionary NSDictionary *songInfo = [[NSDictionary alloc] initWithObjects:propertyValues forKeys:propertyKeys]; return songInfo; } </code></pre> <p>Could it be something in accessing all that Media information that spooks the iPhone?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload