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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:27:11+00:00 2026-05-15T12:27:11+00:00

In my aplication, I have an nsmutablearray which stores a number of types of

  • 0

In my aplication, I have an nsmutablearray which stores a number of types of objects. All these objects are having two similar properties: id, type.

What I’m doing is I’m fetching the current working object in a 1-element array and accessing its properties id, type from within another class. This class is not aware which type of an object is the current object. How shall I access this object?

I tried doing:

commentId = [[appDelegate.currentDeailedObject valueForKey:@"id"] intValue];
commentType = [appDelegate.currentDeailedObject valueForKey:@"type"];

But it didn’t work.

I created an object of type id like this:

id *anObject = [appDelegate.currentDeailedObject objectAtIndex:0];
commentId = [[anObject valueForKey:@"id"] intValue];
commentType = [anObject valueForKey:@"type"];

But it shows me 2 warnings:
1.warning: initialization from incompatible pointer type

2.warning: invalid receiver type ‘id*’

How shall I make this work?

Thanx 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-15T12:27:11+00:00Added an answer on May 15, 2026 at 12:27 pm

    Generic id variables do not generally take a pointer assignment, because it is already a pointer. So you should use something like:

    id anObject = [appDelegate.currentDeailedObject objectAtIndex:0];
    

    You may want to use casts for commentId and commentType, e.g. (NSNumber *), etc.

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

Sidebar

Related Questions

in a simple drawing application I have a model which has a NSMutableArray curvedPaths
I have an action for searching in NSMutableArray with name searcharray, which is equal
I have an application which is having a dictionary returned from a webservice.and i
I have made a question which is a bit similar to this, though the
I have some Core Data entries which are all fetched and thrown into an
Possible Duplicate: iPhone - file properties Hi all. i m creating an application which
I have an NSMutableArray which contains a list of numbers taken from a textfield.
I have an iPhone application in which i am trying to add two mutable
I have an Iphone application in which i am trying to load the two
I have created a class which has a static NSMutableArray, I want this array

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.