I'm trying to compile the code below and I'm getting the following
error.
PatternWrapper.mm:57: error: request for member 'str_pattern' in 'self-
>PatternWrapper::pattern', which is of non-class type 'NS::Pattern*'
Here's what I'm trying to compile in my project.
@interface PatternWrapper : NSObject {
NS::Pattern *pattern;
}
...
@end
- (void)encodeWithCoder:(NSCoder *)encoder
{
...
//Fails on this line here ...
std::string pat = pattern.str_pattern();
...
}
Here's my native c++ method, this compiles into my dylib fine.
string NS::Pattern::str_pattern() {
std::string str;
std::stringstream ss;
ss << id;
cout << "pattern: " << ss << endl;
return ss.str();
}
Any help much appreciated.
Gregory Weston - 26 Apr 2007 04:08 GMT
> I'm trying to compile the code below and I'm getting the following
> error.
[quoted text clipped - 17 lines]
> ...
> }
What with pattern being a pointer and all, shouldn't that '.' be a '->'?
NS::Pattern is a class, but NS::Pattern* isn't.
G