views:

114

answers:

2

I am trying to compile a custom class in Xcode 3 and I keep getting a no matching function call error although the same custom class compiles fine under Windows. Obviously something is not right regarding the use of curly brackets and the XCode compiler. The compiler is choking at the first curly bracket { below:

  : ADataBrowser(inOwnerWindow,inID,inOwner), mEncoding(kTextEncodingMacRoman)
                    {
                        std::memset( mCustomLabels, 0, sizeof(CFStringRef) * kMaxLevelCount);
                    }

Any ideas much appreciated!

//Full source below

#pragma once

#include <ADataBrowser.h>
#include <AControls.h>

enum
{
 kMaxLevelCount = 16
};

class CArray;

class ACustomLabelList :
  public ADataBrowser
{

public:


      ACustomLabelList(
       ControlRef inControl,
       bool inOwner = false)
      : ADataBrowser(inControl, inOwner), mEncoding(kTextEncodingMacRoman)
      {
       std::memset( mCustomLabels, 0, sizeof(CFStringRef) * kMaxLevelCount);
      }

      ACustomLabelList(
       WindowRef inOwnerWindow,
       const ControlID &inID,
       bool inOwner = false)
      : ADataBrowser(inOwnerWindow,inID,inOwner), mEncoding(kTextEncodingMacRoman)
      {
       std::memset( mCustomLabels, 0, sizeof(CFStringRef) * kMaxLevelCount);
      }

      ACustomLabelList(
       WindowRef inOwnerWindow,
       const Rect &inBounds,
       DataBrowserViewStyle inStyle)
      : ADataBrowser(inOwnerWindow, inBounds, inStyle), mEncoding(kTextEncodingMacRoman)
      {
       std::memset( mCustomLabels, 0, sizeof(CFStringRef) * kMaxLevelCount);
      }


 virtual    ~ACustomLabelList();

 void    Initialize(CArray *inArray, const TextStyle &inStyle);

 CFStringRef   GetCurrentSelectionLabelString();
 void    SetCurrentSelectionLabelString(CFStringRef inString);
 void    SetLabelStringAt(CFStringRef inString, DataBrowserItemID inRowID);

 void    ShiftCurrentSelectionUp();
 void    ShiftCurrentSelectionDown();

 void    SendSelectionChangedEvent();

 CFStringRef *  GetLabelList() { return mCustomLabels; }
 void    GetLabelAt(Str15 outString, UInt32 inIndex);

protected:

 virtual void  ItemNotification(
       Item &inItem,
       DataBrowserItemNotification inMessage,
       ItemData &inItemData);

 virtual OSStatus GetItemData(
       Item &inItem,
       DataBrowserPropertyID inProperty,
       ItemData &inItemData);


 virtual OSStatus SetItemData(
       Item &inItem,
       DataBrowserPropertyID inProperty,
       ItemData &inItemData);


 CFStringRef    mCustomLabels[kMaxLevelCount];
 TextEncoding   mEncoding;

private:
       ACustomLabelList(const ACustomLabelList&);
  ACustomLabelList&   operator=(const ACustomLabelList&);
};
A: 

It looks like you're not including the file that declares std::memset.

mipadi
A: 

Added the standard std::memset calls to the #includes, but that didn't help:

include "stdint.h"

include "stdio.h"

... although XCode did make some suggestions re syntax this time:

note: candidates are: ADataBrowser::ADataBrowser(OpaqueWindowPtr*, const Rect&, DataBrowserViewStyle)

note: ADataBrowser::ADataBrowser(OpaqueWindowPtr*, const ControlID&)

note: ADataBrowser::ADataBrowser(const XOwnedRef&)

note: ADataBrowser::ADataBrowser(OpaqueControlRef*)

note: ADataBrowser::ADataBrowser(const ADataBrowser&)

Ian Shortreed