I have been attempting to add the free framework MOKit to a project to add regular expressions to the string methods. There is little available about adding frameworks in XCode 3.2. I’ve been searching for over a week. Any new stuff involves iPhone and is of no use here. Other explanations are for COCOA and don’t apply. Earlier writing has no meaning to me - I just don’t get it. They make it so opaque and involved. Why not just one menu item “Add a framework…”? No, that would be easy then.
The latest framework version is in the folder Library/Frameworks/ and MOKit.framework is (right now) in the Link Binary With Library step in the Targets. (I have had it in a separate copy step previously.)
The main.m file has the added line
#import <MOKit/MOKit.h>
The entire script is
script MOKitAppDelegate
property parent : class "NSObject"
property MO_RegEx : class "MORegularExpression" of current application
on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
on awakeFromNib()
log (MO_RegEx's |class|())
set theMO to MO_RegEx's regularExpressionWithString_("<a na.*I\\d+")
log "1"
log (theMO's |class|())
log (theMO's validExpressionString_("ABC")) as text
end awakeFromNib
end script
The console reads
2010-04-10 20:57:48.460 MOKit[6450:a0f] NSObject
2010-04-10 20:57:48.460 MOKit[6450:a0f] 1
2010-04-10 20:57:48.469 MOKit[6450:a0f] *** -[MOKitAppDelegate awakeFromNib]: The variable theMO is not defined. (error -2753)
Would someone please list the EXACT steps necessary to add a foreign framework to an ASOC project in XCode 3.2.1.