NSURL from a sidebar plist entry (object for key "Alias")?
NSURL from a sidebar plist entry (object for key "Alias")?
- Subject: NSURL from a sidebar plist entry (object for key "Alias")?
- From: b UND d <email@hidden>
- Date: Sat, 25 Mar 2006 17:04:10 +0100
Hi all,
hope you can help me? Probably I have missed sth simple ... how can I
get a valid NSURL from such an object:
Alias = <00000000 013c0002 00010141 00000000 00000000 00000000
00000000 00000000 00000000 0000bcb5 8c15482b 00000002 e2c40946
61766f72 69746573 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000002 ed80b958 5acb005d a9eb005d 494bffff ffff0000
09200000 00000000 00000000 00000000 00074c69 62726172 79000010
00080000 bcb56ff5 00000011 00080000 b9583eab 00000001 000c0002
e2c40002 ddcf0002 d9b20002 001e413a 55736572 733a7062 67343a4c
69627261 72793a46 61766f72 69746573 000e0014 00090046 00610076
006f0072 00690074 00650073 000f0004 00010041 0012001c 55736572
732f7062 67342f4c 69627261 72792f46 61766f72 69746573 00130001
2f000015 0002000b ffff0000 >
Here's what I got so far:
==================================================
...
NSString *sidebarPath = @"~/Library/Preferences/
com.apple.sidebarlists.plist";
sidebarPath = [sidebarPath stringByExpandingTildeInPath];
NSData *plistData;
NSString *error;
NSPropertyListFormat format;
NSDictionary *plist;
plistData = [NSData dataWithContentsOfFile:sidebarPath];
plist = [NSPropertyListSerialization propertyListFromData:plistData
mutabilityOption:NSPropertyListImmutable
format:&format
errorDescription:&error];
if(!plist)
{
NSLog(error);
[error release];
}
NSDictionary *theUserItems = [sidebarListsPlist
objectForKey:@"useritems"];
NSArray *ListItems = [theUserItems objectForKey:@"CustomListItems"];
for (j=0;j<[ListItems count];j++) {
...
NSString *theName = [[ListItems objectAtIndex:j]
objectForKey:@"Name"];
NSData *theAlias = [[ListItems objectAtIndex:j]
objectForKey:@"Alias"];
NSURL * theURL = ... //???
}
...
==================================================
how can I decode the data in theAlias? Or is the mistake I made in an
earlier part of this?
Many thanks for your help in advance!
Dominik
_______________________________________________
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