• 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
Re: warning: return makes pointer from integer without cast
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning: return makes pointer from integer without cast


  • Subject: Re: warning: return makes pointer from integer without cast
  • From: Jason Coco <email@hidden>
  • Date: Tue, 10 Jun 2008 08:45:06 -0400

Hey Steve,

In this case, you are returning a regular integer (count returns just a regular, scalar type). But you've declared your return value as id, which is a typedef for a type of pointer. You either have to return an actual integer, or wrap the return of count in an object like NSNumber.

/jason

On Jun 10, 2008, at 08:32 , Steven Hamilton wrote:

Hi folks, newbie here.

A quickie query on a warning.

Both returns in the following code give a 'warning: return makes pointer from integer without cast'

- (id)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item
{
if (!item) {
return [outlineTree count];
}
return [[outlineTree objectForKey:item] count];


I can't work out why. "count" returns an integer which I should be able to return or does the return only send back a pointer to the integer of which I should be casting earlier on?
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
@gmail.com


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >warning: return makes pointer from integer without cast (From: Steven Hamilton <email@hidden>)

  • Prev by Date: Re: warning: return makes pointer from integer without cast
  • Next by Date: adding a delegate to a class
  • Previous by thread: Re: warning: return makes pointer from integer without cast
  • Next by thread: adding a delegate to a class
  • Index(es):
    • Date
    • Thread