• 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
Unable to access an instance properties and methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unable to access an instance properties and methods


  • Subject: Unable to access an instance properties and methods
  • From: Davide Benini <email@hidden>
  • Date: Wed, 19 Mar 2008 17:33:10 +0100

Hello folks.
I receive an exception message and my application exits whenever I try to access properties or methods of an instance of DBNNote, a custo made class.
Here is the code:


DBNNote *firstNote= [[tune body] objectAtIndex:0];
NSLog(@"%@", firstNote);
NSLog(@"%@", [firstNote accident]);

And this is the exception:

2008-03-19 17:19:30.957 cocoabc[10832:10b] Note: A flat Octave: 6 Duration: 3.000000
2008-03-19 17:19:30.957 cocoabc[10832:10b] *** -[NSCFString accident]: unrecognized selector sent to instance 0x33b040
2008-03-19 17:19:30.958 cocoabc[10832:10b] An uncaught exception was raised
2008-03-19 17:19:30.958 cocoabc[10832:10b] *** -[NSCFString accident]: unrecognized selector sent to instance 0x33b040
2008-03-19 17:19:30.959 cocoabc[10832:10b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** - [NSCFString accident]: unrecognized selector sent to instance 0x33b040'
2008-03-19 17:19:30.959 cocoabc[10832:10b] Stack: (
2505978443,
2451210491,
2506007626,
2506000972,
2506001170,
13259,
8495,
2506037845,
2490420930,
2490380524,
2490378829,
2490377872,
2490377678,
2490376830,
8372,
8298
)


The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to signal 5 (SIGTRAP).


As you see the first line of the exception message correctly logs [firstNote description].
The second NSLog should print "flat".
So it appears the object is correctly instantiated, yet I cannot access its methods. I have tried to call both methods and properties accessors, but no call works so far. I have a feeling I am making a very basic mistake, but I can't tell which one.
Any suggestion?
Davide
_______________________________________________


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


  • Follow-Ups:
    • Re: Unable to access an instance properties and methods
      • From: "Julien Jalon" <email@hidden>
  • Prev by Date: Kentucky Meetup
  • Next by Date: Re: Unable to access an instance properties and methods
  • Previous by thread: Kentucky Meetup
  • Next by thread: Re: Unable to access an instance properties and methods
  • Index(es):
    • Date
    • Thread