Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / April 2007



Tip: Looking for answers? Try searching our database.

obj-c++ error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wizumwalt@gmail.com - 26 Apr 2007 03:12 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.