An exception of class FunctionNotFoundException was not handled. The application must shut down.
Exception Message: Could not load objc_allocateClassPair from Cocoa.Framework
He is using OSX10.9.3 and atm he is the only reporting this. I cannot reproduce this either.
Any thoughts?
This is the declare code.
[code]soft declare function initWithFrame lib “Cocoa” selector “initWithFrame:” (obj_id as Ptr, frameRect as NSRect) as Ptr
soft declare function alloc lib “Cocoa” selector “alloc” (classRef as Ptr) as Ptr
soft declare sub release lib “Cocoa” selector “release” (classRef as Ptr)
soft declare sub addSubview lib “Cocoa” selector “addSubview:” (id as Ptr, aView as Ptr)
soft declare sub setAutoresizingMask lib “Cocoa” selector “setAutoresizingMask:” (id as Ptr, mask as uint32)
soft declare sub setDoubleValue lib “Cocoa” selector “setDoubleValue:” (id as Ptr, value as Double)
soft declare sub setKnobProportion lib “Cocoa” selector “setKnobProportion:” (id as Ptr, value as single)
soft declare sub setScrollerStyle lib “Cocoa” selector “setScrollerStyle:” (id as Ptr, value as uint32)
soft declare sub setEnabled lib “Cocoa” selector “setEnabled:” (id as Ptr, value as Boolean)
soft declare sub setAction lib “Cocoa” selector “setAction:” (id as Ptr, value as ptr)
soft declare sub setTarget lib “Cocoa” selector “setTarget:” (id as Ptr, value as ptr)
soft declare sub setKnobStyle lib “Cocoa” selector “setKnobStyle:” (id as Ptr, value as integer)
soft declare sub setControlSize lib “Cocoa” selector “setControlSize:” (id as Ptr, value as uint32)
soft declare function NSClassFromString lib “Cocoa” (classname as CFStringRef) as ptr
soft declare function class_replaceMethod lib “Cocoa.Framework” (cls as ptr, name as Ptr, imp as Ptr, types as CString) as ptr
soft declare function class_addMethod lib “Cocoa” (cls as Ptr, name as Ptr, imp as Ptr, types as CString) as Boolean
soft declare function method_setImplementation lib “Cocoa.Framework” (cls as ptr, name as Ptr, imp as Ptr) as ptr
soft declare function NSSelectorFromString lib “Cocoa.Framework” (aSelectorName as CFStringRef) as Ptr
soft declare function object_getClass lib “Cocoa.Framework” (obj as Integer) as Ptr
soft declare Function object_setClass lib “Cocoa.Framework” (obj as ptr,c as ptr) as ptr
soft declare function objc_allocateClassPair lib “Cocoa.Framework” (superclass as Ptr, name as CString, extraBytes as Integer) as Ptr
soft declare sub objc_registerClassPair lib “Cocoa.Framework” (cls as Ptr)[/code]
The library should be “libobjc.dylib” (or “libobjc.a.dylib”) for all declares starting with the declare of class_replaceMethod (except for NSSelectorFromString which is correct).
BTW I removed some declares that are not needed.
This is the new declare code:
But that one user keeps getting:
Exception Message: Could not load NSSelectorFromString from Cocoa.Framework
[code] soft declare function initWithFrame lib “Cocoa” selector “initWithFrame:” (obj_id as Ptr, frameRect as NSRect) as Ptr
soft declare function alloc lib “Cocoa” selector “alloc” (classRef as Ptr) as Ptr
soft declare sub release lib “Cocoa” selector “release” (classRef as Ptr)
soft declare sub addSubview lib “Cocoa” selector “addSubview:” (id as Ptr, aView as Ptr)
soft declare sub setAutoresizingMask lib “Cocoa” selector “setAutoresizingMask:” (id as Ptr, mask as uint32)
soft declare sub setDoubleValue lib “Cocoa” selector “setDoubleValue:” (id as Ptr, value as Double)
soft declare sub setKnobProportion lib “Cocoa” selector “setKnobProportion:” (id as Ptr, value as single)
soft declare sub setScrollerStyle lib “Cocoa” selector “setScrollerStyle:” (id as Ptr, value as uint32)
soft declare sub setEnabled lib “Cocoa” selector “setEnabled:” (id as Ptr, value as Boolean)
soft declare sub setAction lib “Cocoa” selector “setAction:” (id as Ptr, value as ptr)
soft declare sub setTarget lib “Cocoa” selector “setTarget:” (id as Ptr, value as ptr)
soft declare sub setKnobStyle lib “Cocoa” selector “setKnobStyle:” (id as Ptr, value as integer)
soft declare sub setControlSize lib “Cocoa” selector “setControlSize:” (id as Ptr, value as uint32)
soft declare function NSClassFromString lib “Cocoa” (classname as CFStringRef) as ptr
soft declare function class_addMethod lib “Cocoa” (cls as Ptr, name as Ptr, imp as Ptr, types as CString) as Boolean
soft declare function NSSelectorFromString lib “Cocoa.Framework” (aSelectorName as CFStringRef) as Ptr
soft declare function objc_allocateClassPair lib “libobjc.dylib” (superclass as Ptr, name as CString, extraBytes as Integer) as Ptr
soft declare sub objc_registerClassPair lib “libobjc.dylib” (cls as Ptr)[/code]
Me neither! But they do! If you can set-up a machine with case sensitive file system, just to catch these weird errors! Apple do advise Objective-C developers to pay attention to case sensitivity, because they allow this option in the first place.
btw, if you change it from “Cocoa.framework” to “Cocoa” it should auto resolve the .framework for you