Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vnraju

macrumors newbie
Original poster
Jun 27, 2007
25
0
in my application....is unable to invoke
applicationDidFinishLaunching: method.........
suggestions plzzzzzz......
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Would you care to elaborate on that? Your application should not invoke that method: NSApplication will invoke it automatically on it's delegate if it:

a) has a delegate

and

b) the delegate responds to that message.
 

vnraju

macrumors newbie
Original poster
Jun 27, 2007
25
0
Would you care to elaborate on that? Your application should not invoke that method: NSApplication will invoke it automatically on it's delegate if it:

a) has a delegate

and

b) the delegate responds to that message.

thanx for ur reply.....

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{

NSLog (@"hi welcome");
}

do i need to change anything
this is the piece of code i wrote in that method..........
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
It's a good idea to use [ code ] (without the spaces) tags around your code to prevent the insertion of :(

That method only gets called if the object that it is a member of is instantiated and set as the NSApplication delegate. Are you doing that (if so where). Personally I normally create an instance of my application delegate and connect it in MainMenu.nib.
 

vnraju

macrumors newbie
Original poster
Jun 27, 2007
25
0
It's a good idea to use [ code ] (without the spaces) tags around your code to prevent the insertion of :(

That method only gets called if the object that it is a member of is instantiated and set as the NSApplication delegate. Are you doing that (if so where). Personally I normally create an instance of my application delegate and connect it in MainMenu.nib.



thank u so much that works fine ...i forget to connect to tha delegate............
 

satyam90

macrumors regular
Jul 30, 2007
242
0
Bangalore, India
what is the code to connect that function to a delegate.
How to declare a delegata and connect it to a function?
Can you please let me know.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
The first question makes no sense. You do not connect "functions" (which are really called methods) to delegates

A delegate is simply an instance of an object. So you create a new class that implements the required methods.

You can then either create an instance of this object in your code and connect it to another object via the setDelegate: method, or you can instantiate this class in your nib and connect it there via the normal connection dragging method.

All of this is covered in any basic Cocoa introduction/tutorial.

I suggest you start reading
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.