Two ABPerson questions (about -copy and -setImageData/-vCardRepresentation)
Two ABPerson questions (about -copy and -setImageData/-vCardRepresentation)
- Subject: Two ABPerson questions (about -copy and -setImageData/-vCardRepresentation)
- From: Greg Anderson <email@hidden>
- Date: Mon, 15 Mar 2004 21:15:40 -0600
I wanted to query the group before I submitted a couple of bug
reports, since a lot of times I ask questions on this list and get back
a, "yeah, that's a known bug," thus saving me the need to report a bug.
So, without further ado ...
#1. The -copy method of ABPerson returns a mutable copy of the object,
but this returned object is the same as the calling object. I
accidentally removed all my user pictures because I was looping through
my shared AB, making a copy, and setting the user image to nil. Little
did I know that -copy was acting as though it was returning an
immutable copy (thus being allowed to simply up the retain count and
return self), but that copy is mutable. Granted, it was my fault really
because I should have called -mutableCopy (which isn't implemented
anyway), but that's beside the point. ;)
#2. If you have an ABPerson that you -setImage
Data:nil with, if you
then try to call -vCardRepresentation on that person, you'll get an
exception of -[NSNull
abEncodeBase64DataBreakLines:allowSlash:padChar:]: selector not
recognized. It looks like setting the image data to nil sets it to an
NSNull object, and when you try to get the VCard out of that, it tries
to get NSNull to handle above method. I'm not sure if this only happens
if the person's not in your Address Book (like in an ABPerson you
created out of VCard data, removed the image data, and then tried to
turn back into VCard data).
I originally found these in 10.3.2, and just tonight checked if 10.3.3
fixed 'em. I have pretty simple code to demonstrate each problem, but I
won't clutter the list unless there's demand for it. Basically, do
these ring a bell with anyone who may have submitted a bug on them, or
any Apple-ites who may know if they're known? If not, I'll head over to
bugreporter.
Thanks much.
Greg
---
Greg T. Anderson
Purveyor of the Binary Clock
http://homepage.mac.com/torgo
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.