Why can't I name a property `tag'?
Why can't I name a property `tag'?
- Subject: Why can't I name a property `tag'?
- From: an0 <email@hidden>
- Date: Thu, 10 Jul 2008 21:25:20 +0800
I have a NSString * property named `tag' in my class Foo, and use Foo
instances to populate an NSOutlineView. In one delegate method of
NSOutlineView, I pass the `tag' property of an item to a method as an
NSString * argument as follows:
- (void)outlineViewSelectionDidChange:(NSNotification *)aNotification
{
NSInteger row = [tagView selectedRow];
if (row == -1) {
return;
}
[filteredPosts release];
filteredPosts = [[self filterPosts:postNodes WithTag:[[tagView
itemAtRow:row] tag]] retain];
[postView reloadData];
}
but a warning of "passing argument 2 of 'filterPosts:WithTag:' makes
pointer from integer without a cast" always pops up when compiling.
I guess it is caused by the fact that NSCell and NSView have a
NSInteger property named `tag'. However, since
* the root class NSObject does not have such a property,
* NSOutlineView's item is typed with id,
* and my class Foo is a direct subclass of NSObject,
what makes XCode think the `tag' property of the item is an NSInteger?
_______________________________________________
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