Hello i'm having a quick question, is there a guid...
# multiplatform
a
Hello i'm having a quick question, is there a guide for kotlin native syntax equvilant of obj c like 1-1 transelation of obj c code to kotlin native ?
a
There’s a guide in the docs, does it have the information you need? https://kotlinlang.org/docs/native-objc-interop.html#mappings
a
i've already read the docs but i'm still having an issue, translating this code snippet for example maybe due to i've no C background, but my case is simple i want to translate few lines of code not whole library wrapper
Copy code
NSFileManager *fileManager = [NSFileManager defaultManager];

//Get documents directory
NSArray *directoryPaths = NSSearchPathForDirectoriesInDomains
(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [directoryPaths objectAtIndex:0];

if ([fileManager fileExistsAtPath:@""] == YES) {
   NSLog(@"File exists");
}
is there a guide that for example rewrites application from C in kotlin native
j
That code seems mostly straightforward:
Copy code
val fileManager = NSFileManager.defaultManager

//Get documents directory
val directoryPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)
val documentsDirectoryPath = directoryPaths[0]

if (fileManager.fileExistsAtPath("")) {
    NSLog("File exists")
}
Did you have questions about a specific syntax? Objective-C is kind of its own beast, even for someone with experience with C.
a
i want to be able to re write any objc snippts from any documentation online inside iosMain but i guess i will learn bit by bit i guess
thanks jeff