Re: xcode 2.2 coredata accessors
Re: xcode 2.2 coredata accessors
- Subject: Re: xcode 2.2 coredata accessors
- From: Aurélien Hugelé <email@hidden>
- Date: Tue, 15 Nov 2005 10:54:06 +0100
Sorry, but I dont understand your answer :
if one of my entity attribute is a float or an int, why do my
accessors should return NSNumber ? there is no "nil" value here, just
0.0 and 0 values...
Moreover, I do a lot of arithmetic with my *entities* *scalar*
*attributes*, and having them as NSNumber is a real pain (until we
can do NSNumber + NSNumber :-D) so changing my accessors to return
NSNumber seems unreasonable.
Should I avoid implementing accessors and use valueForKey: instead ?
and i'll loose type checking, autocompletion and add many typing
errors ?
mmalcom gave a link to NON STANDART attributes accessors... are float
considered non standart ??!!
in listing 2 of this link : http://developer.apple.com/documentation/
Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#//apple_ref/
doc/uid/TP40002154
Apple documentation explains how to implement a float accessor for a
*class* ivar, but no exemple about a float entity attribute. Since
day one, i implement them the same way, and now you want us to change
the implementation to return NSNumber ?
thanks for any explanation on this strange change between Xcode 2.1
and 2.2 behavior....
I must have missed something because it sounds unreasonable to me...
On 15 nov. 05, at 03:29, Miguel Sanchez wrote:
The issue is related to handling of nil values for accessors that
use primitive types instead of an object class (NSNumber).
Basically, if you HAVE NOT generated your own accessors, the
default managed object implementation behaves as if the accessors
were taking full objects (NSNumbers). So we decided to make the
change in the generated accessors to use NSNumber and achieve
functional parity with default non-accessor behavior.
Having accessors that use primitive values might make some of the
UI code (specially using bindings) behave a bit different from the
non-accessor case when it comes to interpreting nil values.
So yes, we recommend that you change your old accessors to use
NSNumber.
Miguel Sanchez
Core Data Team
On Nov 14, 2005, at 3:09 AM, email@hidden wrote:
Hi
In Xcode 2.1, accessors for numeric values automatically created
by xcode from the core data model with "Copy Method
Implementations" were like
(float)mynumber
(int)mynumber
Xcode 2.2 now creates accessors which are all
(NSNumber *)mynumber
Should I replace all my previous int/float accessors with the new
NSNumber* accessors or do they still perform as well as before?
Thanks
Pierre
_______________________________________________
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gumitech.com
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