• 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
Beginners question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Beginners question


  • Subject: Beginners question
  • From: Ronald Hofmann <email@hidden>
  • Date: Thu, 3 Mar 2005 01:03:19 +0100

Hi everybody,
I am doing my first small project. Right now I´m trying to put the current date into a text field.


I connected the text field properly in IB and declared it my MyDocument.h with: IBOutlet NSTextField *dateTime;

in my MyDocument.h I have the following:

#import <Foundation/NSCalendarDate.h>

- (IBAction)awakeFromNib
{
	NSCalendarDate *now;
	now=[NSCalendarDate calenderDate];
	[dateTime setObjectValue:now];
}

When compiling I´m gettig this error:
2005-03-03 00:55:56.683 Downloader[522] *** +[NSCalendarDate calenderDate]: selector not recognized


I´m confused why I receive this. Can somebody please give me a hint?

Regards, Ronald
===============
Am 03.03.2005 um 00:28 schrieb Antonio Ferraioli:

Hello,
I hope my english will be clear enough:

- I develop a program that I cannot always test directly
- remote final users help me with testing
- those user are not developers and does not have developer tools installed
on their machines
- actually they can activate a logging mode and produce
a log file containing a trace of the program execution
- this log is generated introducing a couple of NSLog calls
in many important methods ( i use some macros to do this)
the result of the macro explosion is very similar to the following


	- (void) foo
	{
	  if (gDebugging) NSLog(@"foo - Enter");

	  --
	  -- ......
	  -- ......
	  -- the method code
	  -- ......
	  -- ......

	  if (gDebugging) NSLog(@"foo - Exit");
	}

- recently I discovered a very interesting feature of the gcc  compiler
  the "-finstrument-functions" compile option

activating this option force the compiler to automatically introduce
a couple of calls before entering and after exiting of all my methods
those calls are directed to the following functions:


/** According to gcc documentation: called upon function entry */
static UInt32 callDeep = 0;

void __attribute__((__no_instrument_function__))
__cyg_profile_func_enter(void *this_fn, void *call_site)
{
	callDeep++;
    NSLog(@"enter %p", this_fn);
}

/** According to gcc documentation: called upon function exit */
void __attribute__((__no_instrument_function__))
__cyg_profile_func_exit(void *this_fn, void *call_site)
{
	NSLog(@"exit %p", this_fn);
    callDeep--;
}

- this is a very interesting feature and could permit me to creare
   a trace solution for my program very powerful

	1) I could enable and disable tracing in a single point
	     without adding macros to all the methods of my program

	2) I could generate a log that graphically shows nested calls

		------------ enter Method One
	         ------------------- enter Method Two
	         ------------------- exit    Method Two
		------------ exit Method One

- and finally, if you are not too tired for this long description,
   my question

	I need some explanation on how I could use the input parameters
 	of the two called functions
		__cyg_profile_func_enter(void *this_fn, void *call_site)
		__cyg_profile_func_exit(void *this_fn, void *call_site)

the "this_fn" should (I'm not sure) be a ponter to the function/method
called between the enter and the exit __cyg... functions


	I arrived to convert this address to the called function name
	 using the "atos" terminal command,

I'd like to know if it possible (and how) to make this conversion
directly from my tracing routines without the need to use the atos command
(my remote users does not have atos installed on their "non developer" machines)
I gave a look to the dyld(3) manual but with no success


	also some information about the meaning of the  call_site parameter
	could be very interesting for me

thank you all fo reading all this
and eventually to help me finding a solution
sincerely
antonio





	 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Beginners question
      • From: kishore <email@hidden>
    • Re: Beginners question
      • From: Ricky Sharp <email@hidden>
References: 
 >Help in using the gcc -finstrument-functions option for tracing programs execution (From: Antonio Ferraioli <email@hidden>)

  • Prev by Date: Re: NSTableView content binding (and friends)
  • Next by Date: Re: keyDown:not receiving Command + key events, space bar, left/right arrows
  • Previous by thread: Re: Help in using the gcc -finstrument-functions option for tracing programs execution
  • Next by thread: Re: Beginners question
  • Index(es):
    • Date
    • Thread