Re: warning: return makes pointer from integer without cast
Re: warning: return makes pointer from integer without cast
- Subject: Re: warning: return makes pointer from integer without cast
- From: John Pannell <email@hidden>
- Date: Tue, 10 Jun 2008 06:43:27 -0600
Hi Steven-
Your method signature says the method returns an object ("id"), but
your return values you give back are int. I think that may be where
your code is making a pointer from an int without a cast.
I'm guessing you are implementing this as an outlineView datasource...
in this case, the correct method signature is returning an int.
Hope this helps!
John
John Pannell
http://www.positivespinmedia.com
On Jun 10, 2008, at 6:32 AM, 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:
This email sent to email@hidden