Re: NSString propertyList crash
Re: NSString propertyList crash
- Subject: Re: NSString propertyList crash
- From: Keith Wilson <email@hidden>
- Date: Mon, 20 Mar 2006 13:47:50 +1100
You code works fine on my machine but maybe your BlueTooth plist is
more than just just a dictionary.
- have you tried opening it using:
id plist;
NSData *plistData = [NSData dataWithContentsOfFile:path];
if( ! (plist = [NSPropertyListSerialization
propertyListFromData:plistData
mutabilityOption:NSPropertyListImmutable
format:&format
errorDescription:&errorString]))
{
... display the error
}
Keith
On 20/03/2006, at 1:10 PM, Tito Ciuro wrote:
Hello again,
Consider the following code:
NSString *dirPath = [@"~/Library/Preferences/
com.apple.Bluetooth.plist" stringByExpandingTildeInPath];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:
dirPath];
NSString *desc = [dict description];
NSDictionary *newDict = [desc propertyList];
It seems that the Bluetooth plist is wrongly formatted (needs a
missing semicolon) which crashes NSString's propertyList. Here's
the backtrace:
#0 0x92902228 in -[NSException raise] ()
#1 0x9290207c in +[NSException raise:format:] ()
#2 0x92966f54 in -[NSString(NSExtendedStringPropertyListParsing)
propertyList] ()
#3 0x0003cbc8 in -[MainController testBluetoothPlist:]
(self=0x3450d0, _cmd=0x3450e0, sender=0x33ec80) at /Users/tciuro/
Desktop/OCTester/MainController.m:126
Since 'dict' is a valid dictionary and gets converted to a string,
there is no reason why the opposite should not work, correct? I
guess I should consider this as a bug, no?
Thanks,
-- Tito
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40bigpond.net.au
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden