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 9173639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:37:09+00:00 2026-06-17T16:37:09+00:00

I have been using Objective C for quite a few years but I didn’t

  • 0

I have been using Objective C for quite a few years but I didn’t know @ sign can be used like this (line 6 inside the for loop):

- (void)encodeWithCoder:(NSCoder *)coder
{
    [coder encodeInteger:mti forKey:@"mti"];

    NSMutableArray *arr = [NSMutableArray arrayWithCapacity:N];
    for (int i = 0; i < N; i++)
        [arr addObject:@(mt[i])];
    [coder encodeObject:arr forKey:@"mt"];
}

What does it mean? surprisingly I can remove it and the compiler does not complain and the code looks like working fine?!

This is part of MTRandom https://github.com/preble/MTRandom/blob/master/MTRandom/MTRandom.m#L115

  • 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-06-17T16:37:10+00:00Added an answer on June 17, 2026 at 4:37 pm

    In this context, the @ operator converts a C numeric value (int, long, float, double, etc) into an instance of NSNumber. It’s most often used with numeric literals (eg @3.5), but also applies to expressions as in your example.

    This enhancement to the Objective-C language was introduced with Xcode 4.4.

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

Sidebar

Related Questions

I have been using different methods that are used in Objective-C. Can any one
I have been using Objective-C for a little while but being from a static
I've been using Objective-C for a while now, but have never really understood what
I have been using objective-C to develop in iOS. Now we want to develop
I have been using TortoiseSVN for some time and I really like it. I
I have been learning and using Objective-C and cocos2d (iOS game-engine) for a couple
I'm new to Objective-C and iPhone development and have been using Apress' Beginning iPhone
I have been experimenting with Objective-C using GCC + GNUstep on an Ubuntu system.
I'm very experienced in C/C++/Objective-C and over the last few days have been trying
In Objective C I have been using this code to format a value so

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.