galex
06/06/2019, 8:14 AMdarkmoon_uk
06/06/2019, 8:13 PMandrew
06/10/2019, 10:44 PMdarkmoon_uk
06/14/2019, 10:48 AMmain
function inside runBlocking
? I'm aware that only the main thread can be used for coroutines at present, and have created a main thread Dispatcher, but launching with this dispatcher - according to the error I'm receiving - does not set up an Event Loop.pardom
06/20/2019, 9:00 PMMarc Reichelt
07/01/2019, 11:28 AMMarc Reichelt
07/01/2019, 12:46 PMMarc Reichelt
07/04/2019, 1:30 PMmpp-example
up and running with Kotlin 1.3.40?darkmoon_uk
07/05/2019, 5:18 AMRainer Schlonvoigt
08/02/2019, 10:59 AMHauke Radtki
09/09/2019, 10:18 AMval prop = SomeClass::property
?Rainer Schlonvoigt
09/09/2019, 1:49 PMCannot create binary debugFramework: binary with such a name already exists
einar
09/26/2019, 5:36 PMNo enum constant org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.PREPROD
. (Im using cocoapods)Steve Young
10/07/2019, 1:39 PMTim Hauptmann
10/17/2019, 12:12 PMimport kotlinx.cinterop.CValue
import kotlinx.cinterop.cValue
import kotlinx.cinterop.useContents
import platform.CoreGraphics.CGRect
import platform.UIKit.NSDirectionalEdgeInsetsMake
import platform.UIKit.UIScrollView
class Test(frame: CValue<CGRect>) : UIScrollView(frame) {
private val innerInsets = NSDirectionalEdgeInsetsMake(top = 15.0, leading = 8.0, bottom = 15.0, trailing = 8.0)
companion object {
private val companionInsets = NSDirectionalEdgeInsetsMake(top = 15.0, leading = 8.0, bottom = 15.0, trailing = 8.0)
}
fun useInner(): Double {
return innerInsets.useContents { top } //This line works
}
fun useCompanion(): Double {
return companionInsets.useContents { top } //This line produces runtime crash on iOS Simulator: Thread 1: EXC_BAD_ACCESS
}
}
JoakimForslund
10/23/2019, 1:25 PMUndefined symbols for architecture armv7:
"_OBJC_CLASS_$_KotlinLong", referenced from:
objc-class-ref in TestViewController.o
Is there anything to do about that?Dmitri Sh
10/24/2019, 1:10 AMinterface Idea
. When in Swift, want to have a struct implement this interface, a.k.a now as protocol in the Swiftland. Get a compiler error - inheritance from non-protocol type 'Idea'.
In the generated objective-c file I see this - __attribute__((objc_subclassing_restricted))
. Reading on it, all objective c protocols are restricted to classes. So how I do get around this problem - or no getting around and have to use classes in Swift😥?Konstantin Petrukhnov
10/28/2019, 12:23 PMRainer Schlonvoigt
11/08/2019, 12:57 PMTim Hauptmann
11/14/2019, 9:36 AMdarkmoon_uk
11/17/2019, 10:51 PMKonstantin Petrukhnov
11/19/2019, 4:42 PMlet b1 = Bundle(for: KotlinInt.self).bundlePath
But calling similar code in Kotlin code resolved to main app bundle (same with specific MyClass that inside framework):
val bundle1 = NSBundle.bundleForClass(object_getClass(Int)!!).bundlePath
Calling to get all bundles, successfully resolve all bundles as list:
val bundle7 = NSBundle.allBundles().joinToString { (it as NSBundle).bundlePath }
Is there some better way, than iterate through all bundles and try to find resource in each of it?
(bundle as NSBundle).pathForResource(fileName, null)
ribesg
11/25/2019, 3:21 PMNSInputStream
into a ByteArrayChannel
without filling the RAM? Anyone got an example of that? I’ve got something which does not seem to work and even freezes the app with bigger filesAndreas Jost
11/26/2019, 10:20 AMactual fun ViewContainer.setOnCLickListener(block: () -> Unit) {
val funRef = StableRef.create(InvokeClickListener(block))
this.addGestureRecognizer(UITapGestureRecognizer(this, funRef.asCPointer()))
}
class InvokeClickListener(private val block: () -> Unit) : () -> Unit {
override operator fun invoke() {
block()
}
}
I already managed to set the visibility of Views in the common code. If interested I can post code snippets in the multiplatform channel. But this case is harder, because UITapGestureRecognizer wants a selector/COpaquePointer and I can't find a solution.
Error: 'NSInvalidArgumentException', reason: '(null): unrecognized selector sent to instance 0x7f9da94c0a00'
Thanks in advance!Andreas Jost
12/05/2019, 1:30 PMfun keychainQuery(key: String) =
CFDictionaryCreateMutable(null, 5, null, null).also {
CFDictionaryAddValue(it, kSecClassGenericPassword, kSecClass)
CFDictionaryAddValue(it, key.cstr, kSecAttrService)
CFDictionaryAddValue(it, kSecAttrAccessibleWhenUnlockedThisDeviceOnly, kSecAttrAccessible)
}
fun load(key: String) : String {
val query = keychainQuery(key)
CFDictionaryAddValue(query, kCFBooleanTrue, kSecReturnData)
CFDictionaryAddValue(query, kCFBooleanTrue, kSecReturnAttributes)
memScoped {
val result: CFTypeRefVar = alloc()
val status = SecItemCopyMatching(query, result.ptr)
val resultsDict = result as CFDictionaryRef // <-- This cast can never succeed
val resultsData: COpaquePointer? = CFDictionaryGetValue(result, kSecValueData)
}
}
Hauke Radtki
12/06/2019, 2:25 PMclass Foo(val ref: () -> Long = ::defaultReference)
does not allow Foo to be instantiated in iOS without specifying a value for ref
ribesg
12/11/2019, 10:29 AMkpgalligan
12/11/2019, 10:22 PMe: java.lang.IllegalStateException: no implementation for @kotlin.native.SymbolName public final external fun compareAndSet(expected: T, new: T): kotlin.Boolean defined in kotlin.native.concurrent.AtomicReference[DeserializedSimpleFunctionDescriptor@3a66e67e]
Cristián Arenas
01/05/2020, 2:57 AMNSRange
in Kotlin?
I can’t find init(location: Int, length: Int)
, I can only find a constructor that requires a kotlinx.cinterop.NativePtr
🤔gonzooin
01/08/2020, 2:42 PMinit {
uiView.searchTextField.addTarget(this, platform.darwin.sel_registerName("searchTextChanged"), UIControlEventEditingChanged)
}
@ObjCAction
private fun searchTextChanged() {
// some code
}
iOS Crash
2020-01-08 15:34:46.891004+0100 Production[69085:8719071] -[kobjcc0 searchTextChanged]: unrecognized selector sent to instance 0x6000036b1620
2020-01-08 15:34:46.897007+0100 Production[69085:8719071] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[kobjcc0 searchTextChanged]: unrecognized selector sent to instance 0x6000036b1620'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c91fd4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23c75c4c ___forwarding___ + 1436
4 CoreFoundation 0x00007fff23c77f78 _CF_forwarding_prep_0 + 120
5 UIKitCore 0x00007fff48093fff -[UIApplication sendAction:to:from:forEvent:] + 83
6 UIKitCore 0x00007fff47a6c00e -[UIControl sendAction:to:forEvent:] + 223
7 UIKitCore 0x00007fff47a6c358 -[UIControl _sendActionsForEvents:withEvent:] + 398
8 UIKitCore 0x00007fff4839655f -[UITextField fieldEditorDidChange:] + 202
9 UIKitCore 0x00007fff4837b53a -[UIFieldEditor textInputDidChange:] + 61
10 UIKitCore 0x00007fff483a6d45 -[UITextInputController _sendDelegateChangeNotificationsForText:selection:] + 104
11 UIKitCore 0x00007fff483a9628 -[UITextInputController _insertText:fromKeyboard:] + 765
12 UIKitCore 0x00007fff483aa07f -[UITextInputController insertText:] + 336
13 UIKitCore 0x00007fff4837ec97 -[UIFieldEditor insertFilteredText:] + 838
14 UIKitCore 0x00007fff4839c5e3 -[UITextField insertFilteredText:] + 93
15 UIKitCore 0x00007fff47ea906b -[UIKeyboardImpl insertText:] + 147
16 UIKitCore 0x00007fff47ea3863 -[UIKeyboardImpl _performKeyboardOutput:shouldCheckDelegate:] + 1059
17 UIKitCore 0x00007fff47ea24bd __55-[UIKeyboardImpl handleKeyboardInput:executionContext:]_block_invoke_2 + 372
18 UIKitCore 0x00007fff47ed1ab1 -[UIKeyboardTaskEntry execute:] + 147
19 UIKitCore 0x00007fff47ed05c7 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 310
20 Foundation 0x00007fff25781c30 __NSThreadPerformPerform + 259
21 CoreFoundation 0x00007fff23bd4471 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x00007fff23bd439c __CFRunLoopDoSource0 + 76
23 CoreFoundation 0x00007fff23bd3b74 __CFRunLoopDoSources0 + 180
24 CoreFoundation 0x00007fff23bce87f __CFRunLoopRun + 1263
25 CoreFoundation 0x00007fff23bce066 CFRunLoopRunSpecific + 438
26 GraphicsServices 0x00007fff384c0bb0 GSEventRunModal + 65
27 UIKitCore 0x00007fff48092d4d UIApplicationMain + 1621
28 Production 0x000000010c1b1359 platform_UIKit_UIApplicationMain_wrapper64 + 89
29 Production 0x000000010c10a7cb kfun:main(kotlin.Array<kotlin.String>) + 1371
30 Production 0x000000010c10ab1c Konan_start + 156
31 Production 0x000000010c17249f Init_and_run_start + 111
32 libdyld.dylib 0x00007fff5227ec25 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
my code is inspired from KotlinFinder project ( https://github.com/JetBrains/KotlinFinder/blob/master/ios-app/src/iosMain/kotlin/Views/CollectWordView.kt )gonzooin
01/08/2020, 2:42 PMinit {
uiView.searchTextField.addTarget(this, platform.darwin.sel_registerName("searchTextChanged"), UIControlEventEditingChanged)
}
@ObjCAction
private fun searchTextChanged() {
// some code
}
iOS Crash
2020-01-08 15:34:46.891004+0100 Production[69085:8719071] -[kobjcc0 searchTextChanged]: unrecognized selector sent to instance 0x6000036b1620
2020-01-08 15:34:46.897007+0100 Production[69085:8719071] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[kobjcc0 searchTextChanged]: unrecognized selector sent to instance 0x6000036b1620'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c91fd4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23c75c4c ___forwarding___ + 1436
4 CoreFoundation 0x00007fff23c77f78 _CF_forwarding_prep_0 + 120
5 UIKitCore 0x00007fff48093fff -[UIApplication sendAction:to:from:forEvent:] + 83
6 UIKitCore 0x00007fff47a6c00e -[UIControl sendAction:to:forEvent:] + 223
7 UIKitCore 0x00007fff47a6c358 -[UIControl _sendActionsForEvents:withEvent:] + 398
8 UIKitCore 0x00007fff4839655f -[UITextField fieldEditorDidChange:] + 202
9 UIKitCore 0x00007fff4837b53a -[UIFieldEditor textInputDidChange:] + 61
10 UIKitCore 0x00007fff483a6d45 -[UITextInputController _sendDelegateChangeNotificationsForText:selection:] + 104
11 UIKitCore 0x00007fff483a9628 -[UITextInputController _insertText:fromKeyboard:] + 765
12 UIKitCore 0x00007fff483aa07f -[UITextInputController insertText:] + 336
13 UIKitCore 0x00007fff4837ec97 -[UIFieldEditor insertFilteredText:] + 838
14 UIKitCore 0x00007fff4839c5e3 -[UITextField insertFilteredText:] + 93
15 UIKitCore 0x00007fff47ea906b -[UIKeyboardImpl insertText:] + 147
16 UIKitCore 0x00007fff47ea3863 -[UIKeyboardImpl _performKeyboardOutput:shouldCheckDelegate:] + 1059
17 UIKitCore 0x00007fff47ea24bd __55-[UIKeyboardImpl handleKeyboardInput:executionContext:]_block_invoke_2 + 372
18 UIKitCore 0x00007fff47ed1ab1 -[UIKeyboardTaskEntry execute:] + 147
19 UIKitCore 0x00007fff47ed05c7 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 310
20 Foundation 0x00007fff25781c30 __NSThreadPerformPerform + 259
21 CoreFoundation 0x00007fff23bd4471 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x00007fff23bd439c __CFRunLoopDoSource0 + 76
23 CoreFoundation 0x00007fff23bd3b74 __CFRunLoopDoSources0 + 180
24 CoreFoundation 0x00007fff23bce87f __CFRunLoopRun + 1263
25 CoreFoundation 0x00007fff23bce066 CFRunLoopRunSpecific + 438
26 GraphicsServices 0x00007fff384c0bb0 GSEventRunModal + 65
27 UIKitCore 0x00007fff48092d4d UIApplicationMain + 1621
28 Production 0x000000010c1b1359 platform_UIKit_UIApplicationMain_wrapper64 + 89
29 Production 0x000000010c10a7cb kfun:main(kotlin.Array<kotlin.String>) + 1371
30 Production 0x000000010c10ab1c Konan_start + 156
31 Production 0x000000010c17249f Init_and_run_start + 111
32 libdyld.dylib 0x00007fff5227ec25 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
my code is inspired from KotlinFinder project ( https://github.com/JetBrains/KotlinFinder/blob/master/ios-app/src/iosMain/kotlin/Views/CollectWordView.kt )Andreas Jost
01/08/2020, 2:51 PMgonzooin
01/08/2020, 2:52 PM