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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:55:45+00:00 2026-06-14T19:55:45+00:00

I created a class called card with the following header file and a body

  • 0

I created a class called “card” with the following header file and a body file with the @synthesize’s. The problem is that the app crashes when i try to get the value of typeOfCard. Am i stupid? When i debug it, the inspctor tells me that this variable is an int and it tells me the correct value, but then the app crashes with the following error:

* Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSArrayM idOfImage]: unrecognized selector sent to instance 0x190f64e0’

#import <Foundation/Foundation.h>

enum cardType {
    hearth = 0,
    bell = 1,
    acorn = 2,
    leaf = 3
    };

@interface card : NSObject {
    int value;
    int idOfImage;
    enum cardType typeOfCard;
}

@property (assign)int value;
@property (assign)int idOfImage;
@property enum cardType typeOfCard;

@end
  • 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-14T19:55:46+00:00Added an answer on June 14, 2026 at 7:55 pm

    try changing the following:

    1) declare your enum like (tip: use capital letters for enumerators, same as with classes)

    typedef enum {
        hearth = 0,
        bell = 1,
        acorn = 2,
        leaf = 3
    } CardType;
    

    2) correct your @property line

    @property (assign) CardType typeOfCard;
    

    3) make sure you have the @synthesize typeOfCard; in your .m

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

Sidebar

Related Questions

I created a class in C++ called Commands (file name commands.cpp). I've taken that
I have created UITableCellView class called NoteCell . The header defines the following: #import
I have a peculiar problem. I created a normal Objective C class called SampleTable.
I have an entity called File, I created a partial class with a property
I have created a class called ShortestTime. I have some functions within it that
I've created a class called SpecialArray and I'd like to customize what sort of
I have created a class called Class1, and in another module, I want to
I've a created a class called Animal as shown below: class Animal{ int eyes,legs;
I have created a class library called AddServiceLibrary in which I have a method
I hava a class called DBhelper, and now I created a new class called

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.