GithubHelp home page GithubHelp logo

CocoaTextField Bug about swiftuix HOT 3 CLOSED

swiftuix avatar swiftuix commented on May 2, 2024 1
CocoaTextField Bug

from swiftuix.

Comments (3)

vmanot avatar vmanot commented on May 2, 2024

@fatbobman could you attach the crash report?

from swiftuix.

fatbobman avatar fatbobman commented on May 2, 2024
struct Bridged2: View {
    @State var text = ""
    var body: some View {
        VStack{
            CocoaTextField(text: $text){Text("name:").foregroundColor(.systemGray3)}
            .placeholder("new:")
        }
    }
}

But if placeholder string == "" , no crush happend

crash report

2020-05-22 08:24:33.360308+0800 SwiftUIX_Study[32123:4912545] -[NSNull renderingMode]: unrecognized selector sent to instance 0x7fff8062d9d0
2020-05-22 08:24:33.372528+0800 SwiftUIX_Study[32123:4912545] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull renderingMode]: unrecognized selector sent to instance 0x7fff8062d9d0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff23e3cf0e __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff50ba89b2 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff23e5dc34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff23e4190c ___forwarding___ + 1436
	4   CoreFoundation                      0x00007fff23e43bf8 _CF_forwarding_prep_0 + 120
	5   UIFoundation                        0x00007fff4812eb81 __NSValidateCoreTextAttributes + 1107
	6   UIFoundation                        0x00007fff4812b88c __NSStringDrawingEngine + 3259
	7   UIFoundation                        0x00007fff4812dcb2 -[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:context:] + 758
	8   UIKitCore                           0x00007fff490d61de -[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 663
	9   UIKitCore                           0x00007fff490d5d38 -[UILabel textRectForBounds:limitedToNumberOfLines:] + 50
	10  UIKitCore                           0x00007fff490db70d -[UILabel _intrinsicSizeWithinSize:] + 384
	11  UIKitCore                           0x00007fff48f970df -[UITextField _intrinsicSizeWithinSize:] + 241
	12  UIKitCore                           0x00007fff490a6bd7 -[UIView(UIConstraintBasedLayout) intrinsicContentSize] + 176
	13  SwiftUI                             0x00007fff2c68e2dd $s7SwiftUI16PlatformViewHostC20intrinsicContentSizeSo6CGSizeVvg + 221
	14  SwiftUI                             0x00007fff2c68e1d8 $s7SwiftUI16PlatformViewHostC20intrinsicContentSizeSo6CGSizeVvgTo + 24
	15  SwiftUI                             0x00007fff2c68e7ed $s7SwiftUI25PlatformViewRepresentablePAAE21layoutTraitsDimension33_A513612C07DFA438E70B9FA90719B40DLL3for4axisAA07_LayoutG0V0H0VSo6UIViewC_So22UILayoutConstraintAxisVtF + 29
	16  SwiftUI                             0x00007fff2c68d018 $s7SwiftUI25PlatformViewRepresentablePAAE21intrinsicLayoutTraits3forAA01_gH0VSo6UIViewC_tF + 40
	17  SwiftUI                             0x00007fff2c68cf8a $s7SwiftUI08ViewLeafC0V12layoutTraitsAA07_LayoutF0VyF + 154
	18  SwiftUI                             0x00007fff2c68cd7c $s7SwiftUI08ViewLeafC0V12sizeThatFits2inSo6CGSizeVAA13_ProposedSizeV_tF + 188
	19  SwiftUI                             0x00007fff2c4a3623 $s7SwiftUI12LayoutEngine33_11D036C9107ACC26C79A5AEAB9A093BFLLV12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVFAGyXEfU_ + 51
	20  SwiftUI                             0x00007fff2c4a34f9 $s7SwiftUI12LayoutEngine33_11D036C9107ACC26C79A5AEAB9A093BFLLV12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 681
	21  SwiftUI                             0x00007fff2c77c2f3 $s7SwiftUI14LayoutComputerV14EngineDelegateC12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 99
	22  SwiftUI                             0x00007fff2c51ad15 $s7SwiftUI36AlignmentModifiedLayoutComputerQuery33_3A1D0350CBB400C95A809DBE8B845F0CLLV0E6EngineV12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 53
	23  SwiftUI                             0x00007fff2c51ae55 $s7SwiftUI36AlignmentModifiedLayoutComputerQuery33_3A1D0350CBB400C95A809DBE8B845F0CLLV0E6EngineVAA0eP8ProtocolA2aGP12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVFTW + 37
	24  SwiftUI                             0x00007fff2c77c2f3 $s7SwiftUI14LayoutComputerV14EngineDelegateC12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 99
	25  SwiftUI                             0x00007fff2c51ad15 $s7SwiftUI36AlignmentModifiedLayoutComputerQuery33_3A1D0350CBB400C95A809DBE8B845F0CLLV0E6EngineV12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 53
	26  SwiftUI                             0x00007fff2c51ae55 $s7SwiftUI36AlignmentModifiedLayoutComputerQuery33_3A1D0350CBB400C95A809DBE8B845F0CLLV0E6EngineVAA0eP8ProtocolA2aGP12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVFTW + 37
	27  SwiftUI                             0x00007fff2c77c2f3 $s7SwiftUI14LayoutComputerV14EngineDelegateC12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 99
	28  SwiftUI                             0x00007fff2c8a28e3 $s7SwiftUI13_ZStackLayoutV12sizeThatFits2in7context8childrenSo6CGSizeVAA13_ProposedSizeV_AA0D13TraitsContextVAA0D15ProxyCollectionVtFAA14ViewDimensionsVAA0dP0VcfU1_ + 83
	29  SwiftUI                             0x00007fff2c8a306b $s7SwiftUI13_ZStackLayoutV12sizeThatFits2in7context8childrenSo6CGSizeVAA13_ProposedSizeV_AA0D13TraitsContextVAA0D15ProxyCollectionVtFAA14ViewDimensionsVAA0dP0VcfU1_TA + 43
	30  SwiftUI                             0x00007fff2c8a241c $s7SwiftUI13_ZStackLayoutV12sizeThatFits2in7context8childrenSo6CGSizeVAA13_ProposedSizeV_AA0D13TraitsContextVAA0D15ProxyCollectionVtF + 1868
	31  SwiftUI                             0x00007fff2c8a2969 $s7SwiftUI13_ZStackLayoutVAA01_D0A2aDP12sizeThatFits2in7context8childrenSo6CGSizeVAA13_ProposedSizeV_AA0D13TraitsContextVAA0D15ProxyCollectionVtFTW + 25
	32  SwiftUI                             0x00007fff2c6f4d23 $s7SwiftUI13_LayoutEngineV12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVFAFyXEfU_ + 83
	33  SwiftUI                             0x00007fff2c6f4b67 $s7SwiftUI13_LayoutEngineV12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 919
	34  SwiftUI                             0x00007fff2c77c2f3 $s7SwiftUI14LayoutComputerV14EngineDelegateC12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 99
	35  SwiftUI                             0x00007fff2c505354 $s7SwiftUI14_PaddingLayoutV12sizeThatFits2in7context5childSo6CGSizeVAA13_ProposedSizeV_AA0D13TraitsContextVAA0D5ProxyVtF + 196
	36  SwiftUI                             0x00007fff2c505423 $s7SwiftUI14_PaddingLayoutVAA05UnaryD0A2aDP12sizeThatFits2in7context5childSo6CGSizeVAA13_ProposedSizeV_AA0D13TraitsContextVAA0D5ProxyVtFTW + 51
	37  SwiftUI                             0x00007fff2c511ac3 $s7SwiftUI17UnaryLayoutEngine05_E7A8F26C05374990D1440492F9DD0779DLLV12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVFAGyXEfU_ + 83
	38  SwiftUI                             0x00007fff2c511979 $s7SwiftUI17UnaryLayoutEngine05_E7A8F26C05374990D1440492F9DD0779DLLV12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 793
	39  SwiftUI                             0x00007fff2c77c2f3 $s7SwiftUI14LayoutComputerV14EngineDelegateC12sizeThatFitsySo6CGSizeVAA13_ProposedSizeVF + 99
	40  SwiftUI                             0x00007fff2c538b02 $s7SwiftUI12RootGeometryV6update7contexty14AttributeGraph0G7ContextVyACGz_tF + 178
	41  SwiftUI                             0x00007fff2c53c4d8 $s7SwiftUI12RootGeometryV14AttributeGraph07UntypedE0AadEP7_update_5graph9attributeySv_So10AGGraphRefaSo11AGAttributeatFZTWTA + 24
	42  AttributeGraph                      0x00007fff2fc60d3d _ZN2AG5Graph11UpdateStack6updateEv + 455
	43  AttributeGraph                      0x00007fff2fc6124b _ZN2AG5Graph16update_attributeEjb + 373
	44  AttributeGraph                      0x00007fff2fc65d53 _ZN2AG8Subgraph6updateEj + 729
	45  SwiftUI                             0x00007fff2c5359e0 $s7SwiftUI9ViewGraphC14runTransaction33_D63C4EB7F2B205694B6515509E76E98BLL2inySo10AGGraphRefa_tF + 224
	46  SwiftUI                             0x00007fff2c535db7 $s7SwiftUI9ViewGraphC13updateOutputs2atyAA4TimeV_tFSb5prefs_Sb9idealSizeAC0F0V7outputstSo10AGGraphRefaXEfU_ + 103
	47  SwiftUI                             0x00007fff2c535a9d $s7SwiftUI9ViewGraphC13updateOutputs2atyAA4TimeV_tF + 125
	48  SwiftUI                             0x00007fff2c81a7db $s7SwiftUI16ViewRendererHostPAAE6render8interval17updateDisplayListySd_SbtFyyXEfU_yyXEfU_ + 811
	49  SwiftUI                             0x00007fff2c819c33 $s7SwiftUI16ViewRendererHostPAAE6render8interval17updateDisplayListySd_SbtFyyXEfU_ + 547
	50  SwiftUI                             0x00007fff2c80f785 $s7SwiftUI16ViewRendererHostPAAE6render8interval17updateDisplayListySd_SbtF + 373
	51  SwiftUI                             0x00007fff2c96f9e2 $s7SwiftUI14_UIHostingViewC14layoutSubviewsyyF + 226
	52  SwiftUI                             0x00007fff2c96fa05 $s7SwiftUI14_UIHostingViewC14layoutSubviewsyyFTo + 21
	53  UIKitCore                           0x00007fff49193678 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2478
	54  QuartzCore                          0x00007fff2b4c6398 -[CALayer layoutSublayers] + 255
	55  QuartzCore                          0x00007fff2b4cc523 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 523
	56  QuartzCore                          0x00007fff2b4d7bba _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 80
	57  QuartzCore                          0x00007fff2b420c04 _ZN2CA7Context18commit_transactionEPNS_11TransactionEd + 324
	58  QuartzCore                          0x00007fff2b4545ef _ZN2CA11Transaction6commitEv + 649
	59  UIKitCore                           0x00007fff48ca3747 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 81
	60  CoreFoundation                      0x00007fff23da0b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
	61  CoreFoundation                      0x00007fff23da0253 __CFRunLoopDoBlocks + 195
	62  CoreFoundation                      0x00007fff23d9b043 __CFRunLoopRun + 995
	63  CoreFoundation                      0x00007fff23d9a944 CFRunLoopRunSpecific + 404
	64  GraphicsServices                    0x00007fff38ba6c1a GSEventRunModal + 139
	65  UIKitCore                           0x00007fff48c8b9ec UIApplicationMain + 1605
	66  SwiftUIX_Study                      0x000000010e8ae07b main + 75
	67  libdyld.dylib                       0x00007fff51a231fd start + 1
	68  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

more

Exception	NSException *	"-[NSNull renderingMode]: unrecognized selector sent to instance 0x7fff8062d9d0"	0x000060000250a580
name	__NSCFConstantString *	"NSInvalidArgumentException"	0x00007fff806436a0
__NSCFString	__NSCFString	
NSMutableString	NSMutableString	
NSString	NSString	
NSObject	NSObject	
isa	Class	__NSCFConstantString	0x00007fff87a90b70
reason	__NSCFString *	"-[NSNull renderingMode]: unrecognized selector sent to instance 0x7fff8062d9d0"	0x0000600000f8dec0
NSMutableString	NSMutableString	
NSString	NSString	
NSObject	NSObject	
isa	Class	__NSCFString	0x00007fff87a90b48
userInfo	void *	NULL	0x0000000000000000
reserved	__NSDictionaryM *	2 key/value pairs	0x0000600002b312e0
[0]	(null)	"callStackReturnAddresses" : 69 elements	
key	__NSCFConstantString *	"callStackReturnAddresses"	0x00007fff80643700
__NSCFString	__NSCFString	
NSMutableString	NSMutableString	
NSString	NSString	
NSObject	NSObject	
isa	Class	__NSCFConstantString	0x00007fff87a90b70
value	_NSCallStackArray *	69 elements	0x000060000250a5b0
[1]	(null)	"callStackSymbols" : 69 elements	
key	__NSCFConstantString *	"callStackSymbols"	0x00007fff80643720
__NSCFString	__NSCFString	
value	_NSCallStackArray *	69 elements	0x000060000250aee0

from swiftuix.

vmanot avatar vmanot commented on May 2, 2024

Can't reproduce it on iOS 14b1, looks like this is a SwiftUI bug. Closing this issue - feel free to reopen if it persists on iOS 14.

from swiftuix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.