discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C beginner question


From: Jeremy Cowgar
Subject: Re: Objective-C beginner question
Date: Thu, 9 Mar 2006 09:26:57 -0500

You are initializing myFraction incorrectly.

Try:

myFraction = [[Fraction alloc] init];

or

myFraction = [Fraction alloc];
[myFraction init];

alloc is a class method indicated by the + in the class interface while init is an instance method, it must be performed on a class instance not a class itself.

Jeremy Cowgar

On Mar 9, 2006, at 9:10 AM, Michael Thaler wrote:

    Fraction *myFraction;
    myFraction = [Fraction alloc];
    myFraction = [Fraction init];





reply via email to

[Prev in Thread] Current Thread [Next in Thread]