iOS Question Method not found

Emme Developer

Well-Known Member
Licensed User
Hi to all, I have this error trying the following code

<B4IExceptionWrapper: Error Domain=caught_exception Code=0 "Method not found: test::, target: <b4i_utility: (null)>" UserInfo={NSLocalizedDescription=Method not found: test::, target: <b4i_utility: (null)>}>

B4X:
Public Sub MakeDir(Parent As String, Dir As String)
    Dim NativeMe As NativeObject = Me
    NativeMe.RunMethod("createDirectory::", Array(Dir,Parent))
End Sub

#if OBJC

-(void)createDirectory:(NSString *)directoryName atFilePath:(NSString *)filePath
{
    NSString *filePathAndDirectory = [filePath stringByAppendingPathComponent:directoryName];
    NSError *error;

    if (![[NSFileManager defaultManager] createDirectoryAtPath:filePathAndDirectory
                                   withIntermediateDirectories:YES
                                                    attributes:nil
                                                         error:&error])
    {
        NSLog(@"Create directory error: %@", error);
    }
}

#End If
I'm trying to call this method from a code module.. anyone can help me?
Thanks you
 

Semen Matusovskiy

Well-Known Member
Licensed User
As I understand, you should call
B4X:
-(void) createDirectory:(NSString *)directoryName atFilePath:(NSString *)filePath
using
B4X:
NativeMe.RunMethod("createDirectory:atFilePath:", Array(Dir,Parent))
 
Top