FROM : Gerald Hanks
DATE : Mon Apr 11 06:51:32 2005
I have a project in which I am using an NSOutlineView, some
CharacterSet(s) (my own class) and some Character(s) (also my own
class)
In my control object I have the delegate function:
- (void)outlineView:(NSOutlineView *)outlineView
setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn
byItem:(id)item {
...
if([item isMemberOfClass:[CharacterSet class]]) {
NSEnumerator * characterEnum;
characterEnum = [[item characters] objectEnumerator];
...
}
...
}
When I compile this code I get the following warnings:
Controller.m:343: warning: multiple declarations for method `characters'
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:141:
warning: using `-(NSString *)characters'
CharacterSet.h:35: warning: also found `-(NSArray *)characters'
/System/Library/Frameworks/AppKit.framework/Headers/
NSTextStorageScripting.h:21: warning: also found `-(NSArray
*)characters'
Controller.m:343: warning: `NSString' may not respond to
`-objectEnumerator'
Everything runs the way it should since my CharacterSet class does in
fact have a method 'characters' which returns the NSArray of
characters, but I would like to know if there is a more appropriate way
to do this so that I do not receive the compiler warnings.
As you can see I am fairly new to cocoa programming and would
appreciate any and all suggestions.
--gerald
DATE : Mon Apr 11 06:51:32 2005
I have a project in which I am using an NSOutlineView, some
CharacterSet(s) (my own class) and some Character(s) (also my own
class)
In my control object I have the delegate function:
- (void)outlineView:(NSOutlineView *)outlineView
setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn
byItem:(id)item {
...
if([item isMemberOfClass:[CharacterSet class]]) {
NSEnumerator * characterEnum;
characterEnum = [[item characters] objectEnumerator];
...
}
...
}
When I compile this code I get the following warnings:
Controller.m:343: warning: multiple declarations for method `characters'
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:141:
warning: using `-(NSString *)characters'
CharacterSet.h:35: warning: also found `-(NSArray *)characters'
/System/Library/Frameworks/AppKit.framework/Headers/
NSTextStorageScripting.h:21: warning: also found `-(NSArray
*)characters'
Controller.m:343: warning: `NSString' may not respond to
`-objectEnumerator'
Everything runs the way it should since my CharacterSet class does in
fact have a method 'characters' which returns the NSArray of
characters, but I would like to know if there is a more appropriate way
to do this so that I do not receive the compiler warnings.
As you can see I am fairly new to cocoa programming and would
appreciate any and all suggestions.
--gerald
| Related mails | Author | Date |
|---|---|---|
| Gerald Hanks | Apr 11, 06:51 | |
| Charilaos Skiadas | Apr 11, 07:01 |






Cocoa mail archive

