• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Yet another stupid newbie's question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Yet another stupid newbie's question


  • Subject: Yet another stupid newbie's question
  • From: "email@hidden" <email@hidden>
  • Date: Tue, 28 Aug 2001 12:16:38 +0200

Hello list,

It's again around type conflicts, pointers and stuff... Probably I'm trying
to mix objects and c-style vars in a wrong way

I've done an array containing integers.
it's filled by:
...
[myArray addObject:[NSNumber numberWithInt:10]];
[myArray addObject:[NSNumber numberWithInt:123]];
[myArray addObject:[NSNumber numberWithInt:4]];
[myArray addObject:[NSNumber numberWithInt:56]];
...

A simple

for (index=0;index<max;index++) {
NSLog (@"debug --> %@", [myArray objectAtIndex:index]);
}

tells me that all values are stored fine.

Well, my question is, how can I do some mathematics (additions, comparing in
size) with this values???

int value=[myArray objectAtIndex:0] makes the compiler scream:
"assignment makes integer from pointer without a cast"... :-(

TIA,
Martin


  • Follow-Ups:
    • Re: Yet another stupid newbie's question
      • From: Guillaume Borios <email@hidden>
  • Prev by Date: Re: C++
  • Next by Date: Notifications
  • Previous by thread: Re: Dynamic Services?
  • Next by thread: Re: Yet another stupid newbie's question
  • Index(es):
    • Date
    • Thread