Skip Menu |

This queue is for tickets about the Mac-Tie-PList CPAN distribution.

Report information
The Basics
Id: 41533
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Mac-Tie-PList

People
Owner: gbrock [...] cpan.org
Requestors: david+perl [...] porkrind.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.01
Fixed in: (no value)



Subject: Test errors on Leopard
I tried to install this (I'm using 10.5) and I got the following test errors: t/10.readxml..........1/12 Can't locate object method "class" via package "NSCFDate" (perhaps you forgot to load "NSCFDate"?) at /Users/david/.cpan/build/Mac-Tie-PList-0.01-5O5uN8/blib/lib/Mac/Tie/PList.pm line 92. It looks like Apple moved the definition of NSCFDate to CoreFoundation and hid it behind some underscores. I'm attaching a patch that got the tests to pass for me.
Subject: Mac::Tie::PList::Scalar-leopard.patch
--- a/lib/Mac/Tie/PList.pm 2006-02-05 22:01:53.000000000 -0800 +++ b/lib/Mac/Tie/PList.pm 2008-12-08 03:15:56.000000000 -0800 @@ -48,6 +48,7 @@ use warnings; use Carp; use Foundation; +use CoreFoundation; use File::Temp qw(tempfile); =item my $hash_ref = Mac::Tie::PList->new($data) @@ -95,7 +96,7 @@ ($plist_obj->isKindOfClass_(NSCFNumber->class)) || ($plist_obj->isKindOfClass_(NSCFBoolean->class)) || ($plist_obj->isKindOfClass_(NSCFData->class)) || - ($plist_obj->isKindOfClass_(NSCFDate->class)) || + ($plist_obj->isKindOfClass_(__NSCFDate->class)) || ($plist_obj->isKindOfClass_(NSCFString->class)) ) { tie my $plist, 'Mac::Tie::PList::Scalar', $plist_obj;
It might be that simply using NSDate instead of NSCFDate is a good solution. See: http://lists.apple.com/archives/cocoa-dev/2003/May/msg00640.html --- PList.pm 2009-03-27 17:31:12.000000000 -0700 +++ lib/Mac/Tie/PList.pm 2009-03-27 17:30:55.000000000 -0700 @@ -95,7 +95,7 @@ ($plist_obj->isKindOfClass_(NSCFNumber->class)) || ($plist_obj->isKindOfClass_(NSCFBoolean->class)) || ($plist_obj->isKindOfClass_(NSCFData->class)) || - ($plist_obj->isKindOfClass_(NSCFDate->class)) || + ($plist_obj->isKindOfClass_(NSDate->class)) || ($plist_obj->isKindOfClass_(NSCFString->class)) ) { tie my $plist, 'Mac::Tie::PList::Scalar', $plist_obj;
This is finally fixed in Mac-Tie-PList-0.02.tar.gz. Just uploading to CPAN. Appears to work for me on 10.4.11 PPC and 10.5.6 Intel Appologies for the ridiculous amount of time this took. Gavin