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

  • Home
  • SEARCH
  • 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 6751477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:55:55+00:00 2026-05-26T12:55:55+00:00

I am new to Objective-C programming. In many tutorials I have been seeing code

  • 0

I am new to Objective-C programming. In many tutorials I have been seeing code with this format:

[[classname function] function];

For example:

[[NSString alloc] initwithformat:parameters];

When I was learning about plist and dictionaries I saw this line of code:

[[self.objname objectAtIndex:indexPath.row] objectForKey:@"somename"];

I believe it follows the syntax: [[objectname function] function]

Can someone please explain how this syntax works and the difference between the first and second example.

Also it would be really helpful if you can provide the equivalent statements in C or Java for these examples.

  • 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-26T12:55:56+00:00Added an answer on May 26, 2026 at 12:55 pm

    [ClassName methodName] is how you call a class method. The equivalent in Java is Classname.methodName();

    [object methodName] is how you call a normal instance method. The equivalent in Java is object.methodName();

    In Objective C you can also ‘nest’ calls in [] brackets. [[Classname method1] method2] is equivalent to calling the class method method1, which returns some object and then calling method2 on that object.

    The equivalent in Java would be Classname.method1().method2();

    Also note that in strict Objective C terminology you don’t ‘call a method on an object’, you ‘send a message to an object’ instead. Same thing, different words.

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

Sidebar

Related Questions

I'm quite new to objective c but have been programming for a while. I
i am new to objective c programming I want to call a function within
I am still new in objective-c programming, I got this exception, but I don't
I am new to Objective C programming. I have created two threads called add
I'm fairly new to Objective-C and iPhone programming so I apologize if this is
First off I am very new to Objective C and iPhone programming. Now that
Hey there, I'm sort of new to Objective-C, and well, programming in general. I
Hey Guys .. I am new to programming in Objective C . I checked
I am fairly new to programming and I am working with Objective C. I
Hey there, I'm a designer thats really new to programming with xcode or Objective-C

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.