<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I've finally got a user interface clobbed together in InterfaceBuilder. I've got a static SWMgr that I'm initializing by calling augmentModules on every ".swd" directory in my application support directory. The error I'm getting seems to indicate that it doesn't like that I'm using Unicode strings (which is what the NSFileManager gives me back):<div><br class="webkit-block-placeholder"></div><div>My code:</div><div><br class="webkit-block-placeholder"></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> fm = NSFileManager.defaultManager()</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> modules = fm.directoryContentsAtPath_( appSupportPath )</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> hasAnyModules = False</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> <span style="color: #aa0d91">for</span> mod <span style="color: #aa0d91">in</span> modules:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> <span style="color: #aa0d91">if</span> mod.pathExtension() == <span style="color: #c41a16">"swd"</span>:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> hasAnyModules = True</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> augmentedPath = appSupportPath + "/" + mod</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> NSLog( <span style="color: #c41a16">"Augmenting path: "</span> + augmentedPath )</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> ScripturesManager.mgr.augmentModules( augmentedPath )</div><div><br></div>
</div><br>But this is resulting in the following error:<div><br class="webkit-block-placeholder"></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; "><b>2007-12-20 11:23:00.718 Scriptures[2919:10b] Creating new SWMgr</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; "><b>2007-12-20 11:23:00.724 Scriptures[2919:10b] Augmenting path: /Users/jbrisbin/Library/Application Support/Scriptures/ESV.swd</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; "><b>2007-12-20 11:23:00.726 Scriptures[2919:10b] <type 'exceptions.NotImplementedError'>: Wrong number of arguments for overloaded function 'SWMgr_augmentModules'.</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; "><b> Possible C/C++ prototypes are:</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; "><b> augmentModules(char const *,bool)</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; "><b> augmentModules(char const *)</b></div>
<div><br class="webkit-block-placeholder"></div><div>So it looks like I've got to covert my Unicode string to a C string or something similar so that SWIG can find the method I'm trying to call.</div><div><br class="webkit-block-placeholder"></div><div>Should I be doing this differently?</div><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><br class="Apple-interchange-newline">Thanks!</div><div><br></div><div>Jon Brisbin</div><div><a href="http://jbrisbin.com">http://jbrisbin.com</a></div><div><br></div></span><br class="Apple-interchange-newline"> </div><br></div></body></html>