Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5992105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:29:01+00:00 2026-05-22T23:29:01+00:00

I am facing some difficulties figuring out what this function in the Apple tutorials

  • 0

I am facing some difficulties figuring out what this function in the Apple tutorials stands for:

[[MyViewController alloc] initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]]

My questions are: what does the “@” stand for before MyViewController?

Addionally, as I am following this tutorial, I was wondering: There are to nibs in my project: the automatically generated MainWindow.xib and MyViewController.xib – I was wondering: why do I have two if I only need one?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:29:02+00:00Added an answer on May 22, 2026 at 11:29 pm

    The @-sign before a string literal means that the string is an instance of NSString.

    @"Hello" <-- NSString object
    "Hello"  <-- Null-terminated char array (C-string)
    

    You can even send messages to it:

    [@"Hello" stringByAppendingString:@" World!"]
    

    You will use NSString objects more often than C-strings.

    If you want to convert a C-string to an NSString object (if you are using C libraries that return such strings for example), you could use this:

    char *myCstring = "Hello, World!";
    NSString *myString = [NSString stringWithUTF8String:myCstring];
    

    About the two nibs: actually you don’t need any nibs at all, but Apple likes to decrease performance by using a nib that only has one window. I don’t know why they do it, but you can create a window in code with only one line, which compiles and runs much faster.

    In your applicationDidFinishLaunching: method:

    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.rootViewController = [[[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil] autorelease];
    // now you can remove the MainWindow.xib nib.
    

    Personally I prefer to use no nibs at all, but that’s one’s own choice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our company is facing some difficulties with our CMS web application. This application was
I'm playing with Remote Actors but I'm facing some difficulties. Consider this server: object
I'm facing a problem with IE6. I took the toggle function from this website
I am facing some difficulties in getting my progress bar to retrieve its progress
The company I'm working for is facing some difficulties and our future is, let's
I am currenctly facing some htaccess/rewriterule issues. (And I am new to this area)
I'm getting ready to implement a source control system (subversion) but I'm facing some
I'm facing the need to enter ragged data in a WinForms application. Some columns
I am facing difficulties to make my own Eclipse Intro Page ( as shown
I've done some web-based projects, and most of the difficulties I've met with (questions,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.