FROM : Davide Benini
DATE : Sat Mar 29 22:06:10 2008
You're right, I just cut bits of my code to make it more synthetic,
variantEnding was allocated in the init method.
At any rate, after an observation by Bill Bumgarner, i realised the
bug was much simpler (and more stupid), as often happens:
NSLog("Blah blah %@", repetitions)
As you said, an integer was used as an id.
Thanks,
Davide
AIl giorno 29/mar/08, alle ore 20:55, Quincey Morris ha scritto:
>
> On Mar 29, 2008, at 12:15, Davide Benini wrote:
>
>> Here is MyClass.h file
>>
>> @interface MyClass : NSObject {
>> int repetitions;
>> NSMutableArray *body; // Il contenuto
>> NSString *key; // in questo modo posso determinare cambi di chiave!
>> }
>
>> - (void) dealloc
>> {
>> [variantEnding release];
>> [body release];
>> [super dealloc];
>> }
>
>>
>> What is wrong with this code?
>
> This can't be your actual code -- '[variantEnding release];' won't
> compile because there's no such instance variable any more.
>
> As for the error, it almost looks as if something is using an old
> version of MyClass.h -- one whose first instance variable is
> declared as an object. The integer value of 'repetitions' is
> apparently being used as an object address. (That's why it doesn't
> fail till you set the value to something other than 0 -- sending a
> message to a nil object pointer is ignored.)
>
> Or maybe you typecast 'repetitions' somewhere? '(NSNumber
> *)repetitions' most certainly won't work.
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/<email_removed>
>
> This email sent to <email_removed>
DATE : Sat Mar 29 22:06:10 2008
You're right, I just cut bits of my code to make it more synthetic,
variantEnding was allocated in the init method.
At any rate, after an observation by Bill Bumgarner, i realised the
bug was much simpler (and more stupid), as often happens:
NSLog("Blah blah %@", repetitions)
As you said, an integer was used as an id.
Thanks,
Davide
AIl giorno 29/mar/08, alle ore 20:55, Quincey Morris ha scritto:
>
> On Mar 29, 2008, at 12:15, Davide Benini wrote:
>
>> Here is MyClass.h file
>>
>> @interface MyClass : NSObject {
>> int repetitions;
>> NSMutableArray *body; // Il contenuto
>> NSString *key; // in questo modo posso determinare cambi di chiave!
>> }
>
>> - (void) dealloc
>> {
>> [variantEnding release];
>> [body release];
>> [super dealloc];
>> }
>
>>
>> What is wrong with this code?
>
> This can't be your actual code -- '[variantEnding release];' won't
> compile because there's no such instance variable any more.
>
> As for the error, it almost looks as if something is using an old
> version of MyClass.h -- one whose first instance variable is
> declared as an object. The integer value of 'repetitions' is
> apparently being used as an object address. (That's why it doesn't
> fail till you set the value to something other than 0 -- sending a
> message to a nil object pointer is ignored.)
>
> Or maybe you typecast 'repetitions' somewhere? '(NSNumber
> *)repetitions' most certainly won't work.
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/<email_removed>
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| No related mails found. | ||






Cocoa mail archive

