• 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: T0 make Application run without using NSApplicationMain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: T0 make Application run without using NSApplicationMain


  • Subject: Re: T0 make Application run without using NSApplicationMain
  • From: j o a r <email@hidden>
  • Date: Mon, 22 Aug 2005 12:14:37 +0200


On 22 aug 2005, at 12.00, prashant sharma wrote:

I am using Xcode 2.1. I hv one cocoa application and i am using NSApplicationMain method in main.m file. Two files Controller and ApplicationHandler hv awakeFromNib method and are integerated with nib file.

What i want to do is to run the application without using NSApplicationMain function. So i created the objects of Controller and ApplicationHandler and called the awakeFromNib method.
There was no error duing building process, but the application doesn't run in the same way as it was running initially.


Is replacing NSApplicationMain function with the calles to respective nib files is enough. I am not creating any GUI with nib. So nib is not being used except that it makes a call to awakefromNib functions of controller and applicationHandler.


I've used somthing like this:

int main(int argc, const char *argv[])
{
    NSAutoreleasePool *ool = [[NSAutoreleasePool alloc] init];

// Skip this if you're not loading any nib file
// [NSBundle loadNibNamed: @"MainMenu" owner: [NSApplication sharedApplication]];


    [[NSApplication sharedApplication] run];

    // Will probably never be reached, but prevents "variable not used"
    // warning, and looks good from a completeness perspective...
    [pool release];

    return 0;
}


j o a r


Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

This email sent to email@hidden

References: 
 >T0 make Application run without using NSApplicationMain (From: "prashant sharma" <email@hidden>)

  • Prev by Date: T0 make Application run without using NSApplicationMain
  • Next by Date: frameworks, dynamic_cast and gcc 4.0
  • Previous by thread: T0 make Application run without using NSApplicationMain
  • Next by thread: frameworks, dynamic_cast and gcc 4.0
  • Index(es):
    • Date
    • Thread