I get the error below when trying to assign a new value (compile
error) to rate in myMethod. Why is this NSNumber considered abstract?
I would like to give it a new value.

@interface
{
        NSNumber *rate;
        // ...
}
// ...
#end

- (id) init
{
        // …
        rate = [[NSNumber alloc] initWithFloat:0.0];
        // now has retain count of 1
}

- (void) myMethod
{
        // ...
        [rate initWithFloat:[[config rate] floatValue]];
        // …
}

*** initialization method -initWithFloat: cannot be sent to an
abstract object of class NSCFNumber: Create a concrete instance!
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to