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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:54:34+00:00 2026-06-08T09:54:34+00:00

Trying to do something really simple, but can’t figure out the syntax. I have

  • 0

Trying to do something really simple, but can’t figure out the syntax.

I have a class called Word.h which has 8 properties, strings and integers. For the sake of keeping things simple, I’ll stick to 2 here:

#import <UIKit/UIKit.h>
@interface Word : NSObject
@property (nonatomic, strong) NSString *word; 
@property (nonatomic, strong) NSNumber *wordLevel;
@end

Both properties are synthesised in the .m file

I then want to create some objects in another file (UIViewController). In the .h file I have this:

#import "Word.h"

and in the .m file, this:

Word *newWord = [[Word alloc] init];
   [newWord setWord:@"theorise"];
   [newWord setWordLevel:6];

Word *newWord1 = [[Word alloc] init];
   [newWord setWord:@"implicit"];
   [newWord setWordLevel:7];

Word *newWord2 = [[Word alloc] init];
   [newWord setWord:@"incredible"];
   [newWord setWordLevel:9];

I now get an error message “Implicit conversion of ‘int’ to ‘NSNumber *’ is disallowed with ARC”

What am I doing wrong…is the property defined incorrectly in the class file?? How do I access this property. It works fine with the string.

I will also want to access the properties later – how do I do that…for example:

cell.label1.text = [newWord2 wordLevel];

Is this the right syntax???

Hoping someone can help me, tearing clumps of hair out here!
M

  • 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-08T09:54:37+00:00Added an answer on June 8, 2026 at 9:54 am

    You declared wordLevel to be an NSNumber, an object. You are treating it in your code like it is a plain C int. You have to decide which your want it to be and treat it that way consistently. For example, for a plain C int property you would instead declare:

    @property (nonatomic, assign) int wordLevel;
    

    On the other hand if you really want wordLevel to be an NSNumber you need to use the setter like this:

    [newWord setWordLevel:[NSNumber numberWithInt:6]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying something really simple here, but can't figure out where I'm going wrong.
This should be really simple, but I can't seem to figure out what to
I'm new to mercurial and I'm trying to do something really simple but can't
I'm trying to do something really simple, but starting to realize that dates in
I am sure this is something really simple, but I am going bonkers trying
im trying to achieve something but i dont really know how I have set
This is something really simple, but I can't seem to find the answer anywhere,
I am trying to do something really basic but can not seem to find
I'm trying to do something really simple, but so far I've been unsuccessful in
I am trying to do something that should be really simple but I am

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.