Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 15th, 2011, 12:19 PM
Friend of Wrox
Points: 1,671, Level: 16
Points: 1,671, Level: 16 Points: 1,671, Level: 16 Points: 1,671, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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 08:26 AM. Reason: typo
Reply With Quote
  #2 (permalink)  
Old April 16th, 2011, 12:44 AM
Wrox Author
Points: 362, Level: 6
Points: 362, Level: 6 Points: 362, Level: 6 Points: 362, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 9 Times in 7 Posts
Default

Is this with Xcode 4 Bob ?
Reply With Quote
  #3 (permalink)  
Old April 16th, 2011, 08:39 AM
Friend of Wrox
Points: 1,671, Level: 16
Points: 1,671, Level: 16 Points: 1,671, Level: 16 Points: 1,671, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 09: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 03: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



All times are GMT -4. The time now is 04:52 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.