简体   繁体   中英

App crashes when calling FlatUIKit methods on iOS

I downloaded and added the classes from FlatUIKit manually to my Xcode project (as installing it via CocoaPods wouldn't download some classes, like UITableViewCell+FlatUI )... Whenever I try to call one of the methods from any of FlatUIKit classes, the app crashes, and this gets displayed on Xcode:

在此输入图像描述

Log:

    CoreFoundation`__CFTypeCollectionRetain:
0x33d5e260:  push   {r4, r7, lr}
0x33d5e262:  mov    r4, r1
0x33d5e264:  add    r7, sp, #4
0x33d5e266:  cbnz   r4, 0x33d5e274            ; __CFTypeCollectionRetain + 20
0x33d5e268:  trap   
0x33d5e26a:  blx    0x33dc7a4c                ; symbol stub for: -[NSOrderedSet intersectsSet:]
0x33d5e26e:  movs   r1, #9
0x33d5e270:  blx    0x33dc7b1c                ; symbol stub for: __61-[NSOrderedSet sortedArrayFromRange:options:usingComparator:]_block_invoke_0
0x33d5e274:  mov    r0, r4
0x33d5e276:  pop.w  {r4, r7, lr}
0x33d5e27a:  b.w    0x33cc7d1c                ; CFRetain
0x33d5e27e:  nop 

I'm guessing this has something to do with ARC? How can I solve this? Here is example code that gives the EXC_BREAKPOINT

    FUIButton *button = [FUIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self action:@selector(loginButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Iniciar Sesión" forState:UIControlStateNormal];
button.frame = CGRectMake(80, 210, 140, 40);

button.buttonColor = [UIColor turquoiseColor];
button.shadowColor = [UIColor greenSeaColor];
button.shadowHeight = 3.0f;
button.cornerRadius = 6.0f;
button.titleLabel.font = [UIFont boldFlatFontOfSize:16];
[button setTitleColor:[UIColor cloudsColor] forState:UIControlStateNormal];
[button setTitleColor:[UIColor cloudsColor] forState:UIControlStateHighlighted];
[[self ScrollView]addSubview:button];

NSLog(@"Oks");

After some tests, FlatUIKit's not longer crashing for me as It was when I posted this question. I think the problem somehow has to do with the library being installed via CocoaPods.

To avoid this problem, I now download de .zip directly from the project page at GitHub, and add it to my project manually. Make sure you drag and drop the "Resources" folder too into your project, as it contains the fonts used by FlatUIKit.

Whenever I need FlatUIKit, I now install it manually, and it haven't crashed for me anymore.

Are you including CoreText.framework in your project? FlatUIKit requires that framework.

Also I see you are using the flat font. Those need to be included as well in your project

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM