Wrox Programmer Forums
|
BOOK: Professional iPhone and iPad Application Development
This is the forum to discuss the Wrox book Professional iPhone and iPad Application Development by Gene Backlin; ISBN: 978-0-470-87819-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional iPhone and iPad Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2011, 11:19 AM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default Chapter 15

I had a minor issue when loading the library, that I eliminated with a validity check. For some reason, some thing in my library was returning a nil value, so loading the musicList was causing a crash. I added in iPodLibrary.m

Code:
#import "iPodLibrary.h"
#import <MediaPlayer/MediaPlayer.h>
#import <AVFoundation/AVFoundation.h>


@implementation iPodLibrary

+(NSMutableDictionary *)musicList
{
    NSMutableDictionary *musicList = [NSMutableDictionary dictionary];
    MPMediaQuery *query = [[MPMediaQuery alloc] init];
    [query addFilterPredicate:[MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithInteger:(MPMediaTypeMusic)] forProperty:MPMediaItemPropertyMediaType]];
    
    for (MPMediaItem *item in [query items]) {
        if (([item valueForProperty:MPMediaItemPropertyAssetURL] != nil) && ([item valueForProperty:MPMediaItemPropertyTitle] != nil)){
        
        [musicList setObject:[item valueForProperty:MPMediaItemPropertyAssetURL]
                      forKey:[item valueForProperty:MPMediaItemPropertyTitle]];
        }
    }
    
    [query release];
    return musicList;
}
to protect against this possibility.

Also, it does not appear to affect the running of the program, but the Console logs the following:

Quote:
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
I don't know what it is trying to tell me, and some research shows that others have had the same log in other situations using Core Data, but no real resolutions have been posted in those message boards.
Any ideas?
Bob

Last edited by thepianoguy; April 16th, 2011 at 07:26 AM.. Reason: typo
 
Old April 15th, 2011, 11:44 PM
Wrox Author
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 9 Times in 7 Posts
Default

Is this with Xcode 4 Bob ?
 
Old April 16th, 2011, 07:39 AM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

Yes, I am using Xcode 4. (and loving the reduction in typing! It is strange that for some reason, Xcode 4 doesn't autofill @class and Xcode 3 did…)

I have also run the downloaded project in Xcode 3.2.6 for comparison, and the same
CPSqliteStatementPerform: message is logged.

One issue with the project itself is that the scrolling in the tableView is extremely sluggish (running on an original iPad), whereas in the iPod on the same device the scrolling is very responsive. I know that UI was not the main focus for this chapter, but I hope to improve this element of the project.

Bob





Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 15 help kyledonmoyer BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 June 30th, 2007 08:06 AM
Chapter 15 rrlevron BOOK: Beginning ASP 3.0 0 November 17th, 2005 03:38 PM
chapter 15 manal_sag BOOK: Beginning ASP 3.0 0 April 22nd, 2005 02:23 PM
Chapter 15!! studentinpain BOOK: Beginning ASP 3.0 16 March 12th, 2004 10:26 AM
Chapter 15 help Lorenzo_G BOOK: Beginning ASP 3.0 1 November 27th, 2003 01:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.