Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 29, 2007, 01:58 AM   #1
vnraju
macrumors newbie
 
Join Date: Jun 2007
my application is not invoking "applicationDidFinishLaunching: " method

in my application....is unable to invoke
applicationDidFinishLaunching: method.........
suggestions plzzzzzz......
vnraju is offline   0 Reply With Quote
Old Oct 29, 2007, 02:05 AM   #2
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
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.
robbieduncan is offline   0 Reply With Quote
Old Oct 29, 2007, 02:09 AM   #3
vnraju
Thread Starter
macrumors newbie
 
Join Date: Jun 2007
Quote:
Originally Posted by robbieduncan View Post
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)applicationDidFinishLaunchingNSNotification *)aNotification
{

NSLog (@"hi welcome");
}

do i need to change anything
this is the piece of code i wrote in that method..........
vnraju is offline   0 Reply With Quote
Old Oct 29, 2007, 02:12 AM   #4
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
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.
robbieduncan is offline   0 Reply With Quote
Old Oct 29, 2007, 02:15 AM   #5
vnraju
Thread Starter
macrumors newbie
 
Join Date: Jun 2007
Quote:
Originally Posted by robbieduncan View Post
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............
vnraju is offline   0 Reply With Quote
Old Oct 30, 2007, 11:50 PM   #6
satyam90
macrumors regular
 
Join Date: Jul 2007
Location: Bangalore, India
Send a message via Yahoo to satyam90
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.
satyam90 is offline   0 Reply With Quote
Old Oct 31, 2007, 12:11 AM   #7
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
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
robbieduncan is offline   0 Reply With Quote
Old Oct 21, 2010, 05:50 PM   #8
spudwaffle
macrumors newbie
 
Join Date: Oct 2010
Outside of Delegate?

Is there a way to use this method outside of a delegate?
spudwaffle is offline   0 Reply With Quote
Old Oct 21, 2010, 08:29 PM   #9
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Quote:
Originally Posted by spudwaffle View Post
Is there a way to use this method outside of a delegate?
You can subscribe to NSApplicationDidFinishLaunchingNotification notifications in any class.
kainjow is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Resolved: "Hiding" init method MickeyT iPhone/iPad Programming 10 Feb 20, 2013 02:49 AM
"The application pubsubagent quit unexpectedly" Can't open Safari ETW 360 Mac Basics and Help 0 Dec 13, 2012 04:51 PM
FDA Listed BP application "bp Salsa" on Sale! $2.99 now for a limited time! Amyshelly iPhone and iPod touch Apps 1 Aug 3, 2012 01:18 PM
Application dock item showing ".app" on every application Pipper99 Mac OS X 10.7 Lion 2 Jul 21, 2012 02:00 PM
Any method for connecting 27" TB to 24" ACD? jonnysods Mac Peripherals 8 Jun 26, 2012 08:02 AM

Forum Jump

All times are GMT -5. The time now is 05:01 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC