• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Use of a int type property
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of a int type property


  • Subject: Re: Use of a int type property
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 29 Mar 2008 12:55:53 -0700


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@hidden)

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:
This email sent to email@hidden


References: 
 >Use of a int type property (From: Davide Benini <email@hidden>)

  • Prev by Date: Re: Thread safe?
  • Next by Date: Fwd: Use of a int type property
  • Previous by thread: Re: Use of a int type property
  • Next by thread: Fwd: Use of a int type property
  • Index(es):
    • Date
    • Thread