Weird crash on present modally a view controller on iOS 7 - ios

I developed an app using a iOS 9 device for testing and everything is fine, but I need the compatibility with iOS 7 also.
At the start I load a view controller with some buttons, one of them should present modally another controller but on iOS 7 device I get a very weird crash:
Objective: {objective 0x165f98c0: <> +
<750:-6.61817e-08>*0x16569cd0.negError{id: 118} +
<999:2>*0x16569ec0.negError{id: 175} + <999:2>0x16570520.negError{id:
172} + <999:1>_UILayoutGuide:0x1655a6c0.Width{id: 176} +
<999:1>*_UILayoutGuide:0x165a3c70.Width{id: 173}} 2016-04-27
15:38:07.483 191PerTe[502:60b] *** Terminating app due to uncaught
exception 'NSInternalInconsistencyException', reason: '{ Rows: 0x16569ec0.posErrorMarker{id: 174} == 0 +
1*0x16569ec0.negError{id: 175} + 1*_UILayoutGuide:0x1655a6c0.Width{id:
176} 0x16570520.posErrorMarker{id: 171} == 0 +
1*0x16570520.negError{id: 172} + 1*_UILayoutGuide:0x165a3c70.Width{id:
173} UITransitionView:0x165a21d0.Height{id: 159} == 960 +
1*0x165f11b0.marker{id: 150} + 2*0x1655ed20.marker{id: 168}
UITransitionView:0x165a21d0.Width{id: 154} == 640 +
1*0x1655f650.marker{id: 164} UITransitionView:0x165a21d0.minX{id:
162} == 0 + 2*0x1658f790.marker{id: 161} + -0.5*0x1655f650.marker{id:
164} UITransitionView:0x165a21d0.minY{id: 163} == 0 +
2*0x1655f080.marker{id: 167} + -1*0x1655ed20.marker{id: 168}
UIView:0x1659fb60.Height{id: 185} == 960 + 1*0x165f11b0.marker{id:
150} + 2*0x1655ed20.marker{id: 168} + 2*0x16559660.marker{id: 194}
UIView:0x1659fb60.Width{id: 188} == 640 + 1*0x1655f650.marker{id:
164} + 2*0x1656b160.marker{id: 190} UIView:0x1659fb60.minX{id: 187}
== 0 + 2*0x165596b0.marker{id: 186} + -1*0x1656b160.marker{id: 190} UIView:0x1659fb60.minY{id: 189} == 0 + 2*0x1656b190.marker{id: 193} +
-1*0x16559660.marker{id: 194} UIWindow:0x165a6fe0.Height{id: 141} == 960 + 1*0x165f11b0.marker{id: 150} UIWindow:0x165a6fe0.Width{id: 136}
== 640 + 1*0x165ae3a0.marker{id: 147} UIWindow:0x165a6fe0.minX{id: 144} == 0 + 2*0x16588c90.marker{id: 143} + -0.5*0x165ae3a0.marker{id:
147} UIWindow:0x165a6fe0.minY{id: 146} == 0 + 2*0x165f4e20.marker{id:
145} + -0.5*0x165f11b0.marker{id: 150}
_UILayoutGuide:0x1655a6c0.Height{id: 182} == 0 +
1*0x1656c6a0.marker{id: 181} _UILayoutGuide:0x1655a6c0.minY{id: 184}
== 960 + 1*0x165f11b0.marker{id: 150} + 2*0x1655ed20.marker{id: 168} + -1*0x1656c6a0.marker{id: 181} + 1*0x1656b5f0.marker{id: 183} + 2*0x16559660.marker{id: 194} _UILayoutGuide:0x165a3c70.Height{id:
178} == 40 + 1*0x1656af20.marker{id: 177}
_UILayoutGuide:0x165a3c70.minY{id: 180} == 0 +
1*0x165676a0.marker{id: 179} objective{id: 1} == {objective
0x165f98c0: <> + <750:-6.61817e-08>*0x16569cd0.negError{id: 118} +
<999:2>*0x16569ec0.negError{id: 175} + <999:2>0x16570520.negError{id:
172} + <999:1>_UILayoutGuide:0x1655a6c0.Width{id: 176} +
<999:1>*_UILayoutGuide:0x165a3c70.Width{id: 173}}
Constraints: Marker:0x16559660.marker{id: 194}
Marker:0x165596b0.marker{id: 186}
(Integralization adjustment:3.20747e-06)
Marker:0x1655ed20.marker{id: 168}
Marker:0x1655f080.marker{id: 167}
Marker:0x1655f650.marker{id:
164} Marker:0x1656b160.marker{id: 190}
(Integralization adjustment:6.41495e-06)
Marker:0x1656b190.marker{id: 193}
Marker:0x1658f790.marker{id: 161}
Marker:0x165ae3a0.marker{id: 147}
Marker:0x165f11b0.marker{id: 150}
<_UILayoutSupportConstraint:0x165676a0
V:|-(0)-[_UILayoutGuide:0x165a3c70] (Names: '|':UIView:0x1659fb60
)> Marker:0x165676a0.marker{id: 179}
<_UILayoutSupportConstraint:0x16569ec0
H:[_UILayoutGuide:0x1655a6c0(0#999)]
priority:999> Marker:0x16569ec0.posErrorMarker{id: 174}
<_UILayoutSupportConstraint:0x1656af20
V:[_UILayoutGuide:0x165a3c70(20)]> Marker:0x1656af20.marker{id: 177}
<_UILayoutSupportConstraint:0x1656b5f0
_UILayoutGuide:0x1655a6c0.bottom == UIView:0x1659fb60.bottom> Marker:0x1656b5f0.marker{id: 183}
<_UILayoutSupportConstraint:0x1656c6a0
V:[_UILayoutGuide:0x1655a6c0(0)]> Marker:0x1656c6a0.marker{id: 181}
<_UILayoutSupportConstraint:0x16570520
H:[_UILayoutGuide:0x165a3c70(0#999)]
priority:999> Marker:0x16570520.posErrorMarker{id: 171}
<_UIWindowAnchoringConstraint:0x16588c90 h=--- v=---
UIWindow:0x165a6fe0.midX == + 160> Marker:0x16588c90.marker{id: 143}
<_UIWindowAnchoringConstraint:0x165f4e20 h=--- v=---
UIWindow:0x165a6fe0.midY == + 240> Marker:0x165f4e20.marker{id: 145}
Integralization Adjustments: 0x165596b0.marker{id: 186}
[] ->
0.000003 0x1656b160.marker{id: 190} [] ->
0.000006
Statistics: 18 rows. Variable counts:
1 -> 6
2 -> 10
3 -> 1
5 -> 1 }: internal error. Cannot find an outgoing row head for incoming head 0x16569cd0.negError{id: 118}, which should never
happen.'
*** First throw call stack: (0x2f3cef83 0x39b7fccf 0x2f3ceec5 0x2fd3a315 0x2fd39e57 0x2fd35b95 0x31beacd3 0x31e832ab 0x31be9bc1
0x31d02f4f 0x31c23d57 0x31c23c73 0x31870111 0x3a06781f 0x3a067777
0x2f3998a1 0x2f398175 0x2f302ebf 0x2f302ca3 0x34208663 0x31c4f14d
0x28f3f 0x3a08cab7) libc++abi.dylib: terminating with uncaught
exception of type NSException (lldb)
I already tried to:
disable size classes
reset all constraints on the other controller, present modally a blank view controller
obviously everything is working on iOS 8/9
Some advice?

Related

EXC_BAD_ACCESS (SIGBUS) on iOS

We are facing iOS crash issue in our one SDK library written in objective-c. This objective-c library is being invoked from swift app developed by our customer.
Following is the code snippet from our sdk, where we are creating multiple threads:-
//Create a queue to collect attributes in parallel
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
//Create group to wait on the task scheduled in global queue
dispatch_group_t group = dispatch_group_create();
// Collect all information1
dispatch_group_async(group, queue, ^{
info1 = [self getInformation1];
});
// Collect all information2
dispatch_group_async(group, queue, ^{
info2 = [self getInformation2];
});
// Collect all information3
dispatch_group_async(group, queue, ^{
info3 = [self getInformation3];
});
// Collect all information4
dispatch_group_async(group, queue, ^{
info4 = [self getInformation4];
});
// Collect all information5
dispatch_group_async(group, queue, ^{
info5 = [self getInformation5];
});
// wait on the group to block the current thread.
int64_t time_delay = 3.0;
dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, time_delay * NSEC_PER_SEC);
long success = dispatch_group_wait(group,timeout);
if(success != 0) {
//Log data to check which bucket is not complete
[Logger writeLogWithSeverity:kLogERROR message:info1];
[Logger writeLogWithSeverity:kLogERROR message:info2];
[Logger writeLogWithSeverity:kLogERROR message:info3];
[Logger writeLogWithSeverity:kLogERROR message:info4];
[Logger writeLogWithSeverity:kLogERROR message:info5];
}
Is this is ideal way or is there any better way to create concurrent threads?
Following are couple of stack traces of the crashes
1)
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: 0x00000000 at 0x0000000323f7bec8
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x000000018193c1a0 0x181918000 + 147872 (objc_retain + 16)
1 abcMobile 0x0000000104365cbc 0x1041c8000 + 1694908 -[DeviceInventory notifyCollectingdeviceInfo:] (DeviceInventory.m:215 + 28)
2 abcMobile 0x0000000104365b78 0x1041c8000 + 1694584 -[DeviceInventory startCollectingdeviceInfo] (DeviceInventory.m:206 + 0)
3 libdispatch.dylib 0x0000000182058b24 0x182057000 + 6948 ( + 24)
4 libdispatch.dylib 0x0000000182058ae4 0x182057000 + 6884 ( + 16)
5 libdispatch.dylib 0x00000001820656e0 0x182057000 + 59104 ( + 1012)
6 CoreFoundation 0x000000018270f070 0x182621000 + 974960 ( + 12)
7 CoreFoundation 0x000000018270cbc8 0x182621000 + 965576 ( + 2272)
8 CoreFoundation 0x000000018262cda8 0x182621000 + 48552 (CFRunLoopRunSpecific + 552)
9 GraphicsServices 0x000000018460f020 0x184604000 + 45088 (GSEventRunModal + 100)
10 UIKit 0x000000018c60d78c 0x18c2f0000 + 3266444 (UIApplicationMain + 236)
11 abcMobile 0x00000001041ccc40 0x1041c8000 + 19520 main (main.swift:14 + 20)
12 libdyld.dylib 0x00000001820bdfc0 0x1820bd000 + 4032 ( + 4)
Crashing code :- [self.delegate didCompletedCollectingInformation:deviceInfo];
didCompletedCollectingInformation is a call-back function
2)
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: 0x00000000 at 0x00000007943dbec8
Crashed Thread: 18
Thread 18 Crashed:
0 libobjc.A.dylib 0x0000000182f3c1a0 0x182f18000 + 147872 (objc_retain + 16)
1 abcMobile 0x0000000100c0150c 0x100a64000 + 1692940 -[DeviceInventory didFailWithError:] (DeviceInventory.m:144 + 28)
2 CoreFoundation 0x0000000183cf8c3c 0x183c21000 + 883772 ( + 20)
3 CoreFoundation 0x0000000183cf81b8 0x183c21000 + 881080 ( + 428)
4 CoreFoundation 0x0000000183cf7f14 0x183c21000 + 880404 ( + 216)
5 CoreFoundation 0x0000000183d7584c 0x183c21000 + 1394764 ( + 1408)
6 CoreFoundation 0x0000000183c2ef38 0x183c21000 + 57144 (_CFXNotificationPost + 384)
7 Foundation 0x000000018469fbbc 0x184699000 + 27580 ( + 68)
8 abcMobile 0x0000000100bf7f80 0x100a64000 + 1654656 +[Errors sendErrorNotifactionForErrorCode:] (Errors.m:405 + 64)
9 abcMobile 0x0000000100bf101c 0x100a64000 + 1626140 +[NetworkInfo information1] (NetworkInfo.m:711 + 0)
10 abcMobile 0x0000000100bfb9fc 0x100a64000 + 1669628 -[Services information1] (Services.m:391 + 20)
11 abcMobile 0x0000000100c058b4 0x100a64000 + 1710260 -[DeviceInventory getInformation1] (DeviceInventory.m:635 + 56)
12 abcMobile 0x0000000100c0268c 0x100a64000 + 1697420 __39-[DeviceInventory getdeviceInfo]_block_invoke.163 (DeviceInventory.m:256 + 16)
13 libdispatch.dylib 0x0000000183658aa0 0x183657000 + 6816 ( + 24)
14 libdispatch.dylib 0x0000000183658a60 0x183657000 + 6752 ( + 16)
15 libdispatch.dylib 0x000000018369a5f0 0x183657000 + 275952 ( + 1148)
16 libdispatch.dylib 0x000000018369a110 0x183657000 + 274704 ( + 112)
17 libsystem_pthread.dylib 0x000000018398bfac 0x18398b000 + 4012 (_pthread_wqthread + 1176)
Crashing code :- if([self.delegate respondsToSelector:#selector(didFailWithError:)])
Here, didFailWithError is a call-back function
We are unable to find the root cause of this crash as it is very random issue. Does anyone have any idea how to fix this crash issue?
Any pointers will be very helpful as we are struck on this issue.

Nested UIStackview issue, removing them cause a crash. How to correctly remove them?

in an attempt to create a spreadsheet like table without using UICollectionViews, I decided to use nested UIStackViews.
However, since I am using them in a UITableViewCell, and programmatically create them, I have to remove them from cell, otherwise, when it redraws the cell, the new views will overlap with the old ones.
But when removing them from parent view, it crashes. How to correctly remove nested UIStackViews?
My Code to create nested UIStackViews:
let table = UIStackView()
table.axis = .Vertical
table.spacing = 8
let json = JSON(data: jsonNew)
for i in 0..<json["Rows"].count{
let horizontal = UIStackView()
horizontal.axis = .Horizontal
horizontal.spacing = 8
for j in 0..<json["Rows"][i]["Column"].count{
let label = UILabel()
label.text = json["Rows"][i]["Column"][j].string!
label.lineBreakMode = .ByWordWrapping
label.numberOfLines = 0
label.font = label.font.fontWithSize(12)
horizontal.addArrangedSubview(label)
}
table.addArrangedSubview(horizontal)
}
This is how I remove all views from cell:
for myview in view.subviews{
myview.removeFromSuperview()
}
This is the error:
2016-05-17 11:37:58.745 TestProject[678:26088] _UIConstraintBasedLayoutLogUnsatisfiable is OFF
2016-05-17 11:38:16.563 TestProject[678:26088] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason:
'{objective 0x12faebf00: <1100:16, 760:-6.10352e-05, 750:100, 251:563,
250:-512.5> +
<760:-1>*0x12ddfbd00:UISV-text-width-disambiguation.negError{id:
13416} +
<760:1>*0x12ddfbd00:UISV-text-width-disambiguation.posErrorMarker{id:
13415} +
<760:-1>*0x12ddfbd50:UISV-text-width-disambiguation.negError{id:
13431} +
<760:1>*0x12ddfbd50:UISV-text-width-disambiguation.posErrorMarker{id:
13430} + <750:1, 250:1>*0x12f80df30.negError{id: 13501} + <750:1,
250:1>*0x12f80f000.negError{id: 13499} +
<250:1>*0x12f84df70:UISV-alignment.marker{id: 13578} +
<250:4.6875>*0x12f85ee40:UISV-canvas-connection.marker{id: 13524} +
<750:1, 250:1>*0x12f873b40.posErrorMarker{id: 13486} +
<1100:1>*0x12f8a5730:UIView-Encapsulated-Layout-Width.marker{id:
13587} + <250:-1>*0x12f8b54e0:UISV-alignment.marker{id: 13557} +
<250:-4.6875>*0x12f8d1d70:UISV-canvas-connection.marker{id: 13522} +
<760:-1>*0x12f904f30:UISV-text-width-disambiguation.negError{id:
13412} +
<760:1>*0x12f904f30:UISV-text-width-disambiguation.posErrorMarker{id:
13411} + <760:1>*0x12f904fa0:UISV-spacing.marker{id: 13413} +
<251:-1>*0x12f98e950.marker{id: 12953} +
<251:1>*0x12f9b0580.marker{id: 12949} +
<760:1>*0x12f9cec00:UISV-canvas-connection.marker{id: 13406} +
<250:4.6875>*0x12fa05f30:UISV-spacing.marker{id: 13535} + <999:1,
250:-5.6875>*0x12fa11cd0:UISV-fill-proportionally.negError{id: 13530}
+ <999:1, 250:5.6875>*0x12fa11cd0:UISV-fill-proportionally.posErrorMarker{id:
13529} + <1100:1>*0x12fa146d0.marker{id: 13000} + <750:1,
250:1>*0x12fa27ab0.posErrorMarker{id: 13492} +
<1100:-1>*0x12fa3cc90.marker{id: 12998} + <750:1,
250:1>*0x12fa3cd80.negError{id: 13511} + <750:1,
250:1>*0x12fa3ea20.negError{id: 13513} +
<250:1>*0x12fa47260:UISV-alignment.marker{id: 13572} + <750:1,
251:1>*0x12fa4e480.negError{id: 13020} + <1100:-1,
251:1>*0x12fa55880.marker{id: 14140} +
<250:1>*0x12fa5bc10:UISV-alignment.marker{id: 13581} + <750:1,
250:1>*0x12fa6a5c0.negError{id: 13495} + <750:1,
250:1>*0x12fa711c0.negError{id: 13483} + <994:1,
250:-5.6875>*0x12fa78560:UISV-fill-proportionally.negError{id: 13547}
+ <994:1, 250:5.6875>*0x12fa78560:UISV-fill-proportionally.posErrorMarker{id:
13546} + <250:-1>*0x12fa7c820:UISV-alignment.marker{id: 13565} +
<250:-1>*0x12fa7c870:UISV-alignment.marker{id: 13567} +
<250:1>*0x12fa7c8c0:UISV-alignment.marker{id: 13569} +
<250:1>*0x12fa7f990:UISV-alignment.marker{id: 13575} +
<250:4.6875>*0x12fa7fc20:UISV-spacing.marker{id: 13527} +
<250:4.6875>*0x12fa93c40:UISV-spacing.marker{id: 13531} + <750:1,
250:1>*0x12fa94dd0.negError{id: 13517} + <750:-1,
250:4.6875>*0x12fa980e0:UISV-hiding.marker{id: 13550} +
<250:-1>*0x12fa98d50:UISV-alignment.marker{id: 13559} + <750:1,
250:1>*0x12fa990f0.negError{id: 13505} + <750:-1,
250:4.6875>*0x12faad3d0:UISV-hiding.marker{id: 13551} + <750:1,
251:1>*0x12fab93e0.negError{id: 13022} + <750:1,
250:1>*0x12fac5ee0.negError{id: 13481} +
<250:7>*0x12facbf60:UISV-canvas-connection.marker{id: 13552} + <750:1,
250:1>*0x12fad6cb0.negError{id: 13489} +
<250:4.6875>*0x12fadb570:UISV-spacing.marker{id: 13543} +
<250:1>*0x12fae21d0:UISV-alignment.marker{id: 13584} +
<250:-7>*0x12fae8940:UISV-canvas-connection.marker{id: 13554} +
<750:1, 250:1>*0x12faec7c0.negError{id: 13519} +
<760:-1>*0x12fc0f8a0:UISV-canvas-connection.marker{id: 13403} +
<251:-1>*0x12fc1a8a0.marker{id: 12975} +
<760:1>*0x12fc276f0:UISV-spacing.marker{id: 13409} +
<760:1>*0x12fc54e40:UISV-spacing.marker{id: 13417} +
<760:-1>*0x12fc54e90:UISV-text-width-disambiguation.negError{id:
13429} +
<760:1>*0x12fc54e90:UISV-text-width-disambiguation.posErrorMarker{id:
13428} + <251:-1>*0x12fc6dd10.marker{id: 12972} +
<1100:1>*0x12fc6e830.marker{id: 12969} +
<760:-1>*0x12fc75b80:UISV-text-width-disambiguation.negError{id:
13424} + <760:1>*0x12fc75bf0:UISV-spacing.marker{id: 13425} +
<760:-1>*0x12fc78190:UISV-text-width-disambiguation.negError{id:
13420} +
<760:1>*0x12fc78190:UISV-text-width-disambiguation.posErrorMarker{id:
13419} + <760:1>*0x12fc78200:UISV-spacing.marker{id: 13421} +
<251:-1>*0x12fc8fd20.marker{id: 12957} +
<1100:1>*0x12fc95e90.marker{id: 12963} +
<250:7>*0x12fc960b0.marker{id: 12955} +
<250:4.6875>*0x12fd06e40:UISV-spacing.marker{id: 13533} + <750:1,
250:1>*0x12fd07210.negError{id: 13507} + <996:1,
250:-5.6875>*0x12fd1a3a0:UISV-fill-proportionally.negError{id: 13538}
+ <996:1, 250:5.6875>*0x12fd1a3a0:UISV-fill-proportionally.posErrorMarker{id:
13537} + <995:1,
250:-5.6875>*0x12fd1b3f0:UISV-fill-proportionally.negError{id: 13542}
+ <995:1, 250:5.6875>*0x12fd1b3f0:UISV-fill-proportionally.posErrorMarker{id:
13541} + <250:4.6875>*0x12fd1bd50:UISV-spacing.marker{id: 13539} +
<993:1, 250:-5.6875>*0x12fd1c370:UISV-fill-proportionally.negError{id:
13549} + <993:1,
250:5.6875>*0x12fd1c370:UISV-fill-proportionally.posErrorMarker{id:
13548} + <250:-1>*0x12fd1e670:UISV-alignment.marker{id: 13561} +
<250:-1>*0x12fd1e6c0:UISV-alignment.marker{id: 13563} +
<750:0.00277778>*UILabel:0x12f884240'2016-04-11'.Width{id: 13061} +
<750:0.00277778>*UILabel:0x12fa2f410'2031839'.Width{id: 13031} +
<750:0.00277778>*UILabel:0x12fa2fd90'OTOTAY İÇ VE DIŞ
PAZ.A.Ş.'.Width{id: 13037} +
<750:0.00277778>*UILabel:0x12fa52010'TL'.Width{id: 13055} +
<750:0.00277778>*UILabel:0x12fafa3d0'MAHMUT ÇETİNTÜRK'.Width{id:
13043} + <750:0.00277778>*UILabel:0x12fafa6a0'15000,00'.Width{id:
13049} + <760:0>*UIStackView:0x12fa081c0.Width{id: 13152} + <760:0,
750:-0.00277778>*UIStackView:0x12fb2b740.Width{id: 13067} +
<760:0>*UIStackView:0x12fc44970.Width{id: 13322} +
<760:0>*UIStackView:0x12fc65df0.Width{id: 13237}}: internal error.
Setting empty vector for variable
UILabel:0x12f905720'6955677'.Width{id: 13371}.'
* First throw call stack:
(0x18221ae38 0x18187ff80 0x18221ad80 0x182b52de0 0x182ccf4d4 0x182b4fcc8 0x182b53108 0x182b50d18 0x182b53928 0x182b585e4
0x182b4d010 0x182b4cd78 0x187464c80 0x187357368 0x187356c1c
0x182b4cd50 0x187356ac4 0x1876702c4 0x1873554e8 0x100143634
0x100148164 0x1876b2f40 0x1876b3120 0x1876b6a2c 0x1874a9500
0x1874a923c 0x1874a8ebc 0x187448aa0 0x1876a1a34 0x1876b7b74
0x1874487ac 0x1873580e4 0x184cfea28 0x184cf9634 0x184cf94f4
0x184cf8b24 0x184cf886c 0x184cf1dd8 0x1821d07b0 0x1821ce554
0x1821ce984 0x1820f8d10 0x1839e0088 0x1873c5f70 0x100107234
0x181c968b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
The problem is due the insidestackview, this one will grow in height variably and the problem is when you scroll down or change the view, and the cells needs to be reused and the other Label content height will be different from the one who is trying to reuse.
The solution may depends what are your needs, but if you want to keep
label.numberOfLines = 0 and label.lineBreakMode = .ByWordWrapping (grow stackview to wrap as many lines as necessary)
You can play with the distribution and Heights and multipliers > 0 in your constraints. So it can be .equalSpacing or if you have a max-height for any of that you can use .fill (which is the default):
Option1:
stack.distribution = .equalSpacing
Option2:
NSLayoutConstraint(item: outsideStackView, attribute: .top, relatedBy: .equal, toItem: parentView, attribute: .bottom, multiplier: 2, constant: 20)
Option3: Give a MaxHeight to inside stackview
Option4: Remove...
label.lineBreakMode = .ByWordWrapping
label.numberOfLines = 0
You need to remove the view from the stackView with removeArrangedSubview, i.e.
for myview in view.subviews{
table.removeArrangedSubview(myview)
myview.removeFromSuperview()
}
UIStackView is a non-rendering UIView which automatically adds subviews to its view heirachy when calling addArrangedSubview, so you don't need to call addSubview. When removing an arrangedSubview, you must call stackView.removeArrangedSubview(view) and view.removeFromSuperview()

LDA Results Errors

So, I am relatively new using Gensim and LDA in general. The problem right now is that when I run LDA on my corpus, the topics' tokens' weights are all 0:
2015-06-15 12:21:12,439 : INFO : topic diff=0.082235, rho=0.250000
2015-06-15 12:21:12,454 : INFO : topic #0 (0.100): 0.000*sundayes + 0.000*nowe + 0.000*easter + 0.000*iniunctions + 0.000*eyther + 0.000*christ, + 0.000*authoritie + 0.000*sir + 0.000*saint + 0.000*thinge
2015-06-15 12:21:12,468 : INFO : topic #1 (0.100): 0.000*eu'n + 0.000*ioseph + 0.000*pharohs + 0.000*pharoh + 0.000*iosephs + 0.000*lo! + 0.000*egypts + 0.000*iacob + 0.000*ioseph, + 0.000*beniamin
2015-06-15 12:21:12,482 : INFO : topic #2 (0.100): 0.000*agreeable + 0.000*creede, + 0.000*fourme + 0.000*conteined + 0.000*apostolike, + 0.000*vicars, + 0.000*sacrament + 0.000*contrarywise + 0.000*parsons, + 0.000*propitiatorie
2015-06-15 12:21:12,495 : INFO : topic #3 (0.100): 0.000*yf + 0.000*suche + 0.000*lyke + 0.000*shoulde + 0.000*moste + 0.000*youre + 0.000*oure + 0.000*lyfe, + 0.000*anye + 0.000*thinges
2015-06-15 12:21:12,507 : INFO : topic #4 (0.100): 0.000*heau'nly + 0.000*eu'n + 0.000*heau'n + 0.000*sweet + 0.000*peace + 0.000*eu'ry + 0.000*constance + 0.000*constant + 0.000*doth + 0.000*oh
2015-06-15 12:21:12,521 : INFO : topic #5 (0.100): 0.000*eu'n + 0.000*ioseph + 0.000*pharohs + 0.000*pharoh + 0.000*vel + 0.000*iosephs + 0.000*heau'n + 0.000*lo! + 0.000*ac + 0.000*seu'n
2015-06-15 12:21:12,534 : INFO : topic #6 (0.100): 0.000*thou + 0.000*would + 0.000*love + 0.000*king + 0.000*sir, + 0.000*doe + 0.000*thee + 0.000*1. + 0.000*never + 0.000*2.
2015-06-15 12:21:12,546 : INFO : topic #7 (0.100): 0.000*quae + 0.000*vt + 0.000*qui + 0.000*ij + 0.000*non + 0.000*ad + 0.000*si + 0.000*vel + 0.000*atque + 0.000*cum
2015-06-15 12:21:12,558 : INFO : topic #8 (0.100): 0.000*suspected + 0.000*supersticious + 0.000*squire + 0.000*parsons + 0.000*ordinarie + 0.000*vsed, + 0.000*english, + 0.000*fortnight + 0.000*squire, + 0.000*offenders
2015-06-15 12:21:12,572 : INFO : topic #9 (0.100): 0.001*/ + 0.001*ile + 0.000*y^e + 0.000*che + 0.000*much + 0.000*tis + 0.000*could + 0.000*oh + 0.000*neuer + 0.000*heart
I have 307 documents and I'm running my LDA with the following code after removing the stopwords:
texts = [[token for token in text if frequency[token] > 3 ] for text in texts]
dictionary = corpora.Dictionary(texts)
corpus = [dictionary.doc2bow(text) for text in texts]
tfidf = models.TfidfModel(corpus)
tfidf_corpus = tfidf[corpus]
lda = models.LdaModel(tfidf_corpus, id2word = dictionary, update_every=1, chunksize= 20, num_topics = 10, passes = 1)
lda[tfidf_corpus]
lda.print_topics(10)
I am not sure what is wrong but everytime I run this, the token weights are 0. What might be causing this and how could I correct this?

Crashing Application

I have 2 viewcontrollers. One contain button from which I am sending request to server and in another viewcontroller I am displaying data in tableview. Now my application crashed sometimes not everytime when it is executing tableview method. I got crashed at method CFRetain Here is my log.
Here is my code of tableview:
#import "SearchResultViewController.h"
#import "UIImageView+AFNetworking.h"
#import "SearchResultCell.h"
#interface SearchResultViewController ()
#end
#implementation SearchResultViewController
- (id)initWithStyle:(UITableViewStyle)style {
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
UIBarButtonItem *btnHelp = [[UIBarButtonItem alloc] initWithTitle:#"Help" style:UIBarButtonItemStylePlain target:self action:#selector(btnHelpAction:)];
self.navigationItem.rightBarButtonItem=btnHelp;
self.title = #"Search Result";
}
-(IBAction)btnHelpAction:(id)sender{
HelpViewController *HVC=[[HelpViewController alloc]init];
UINavigationController *helpNavController=[[UINavigationController alloc]initWithRootViewController:HVC];
[self presentViewController:helpNavController animated:YES completion:nil];}
- (void)setTitle:(NSString *)title {
// [super setTitle:title];
UILabel *titleView = (UILabel *)self.navigationItem.titleView;
if (!titleView) {
titleView = [[UILabel alloc] initWithFrame:CGRectZero];
titleView.backgroundColor = [UIColor clearColor];
titleView.font = [UIFont fontWithName:GZFont size:16.0];
titleView.textColor = [UIColor colorWithRed:241/255.0 green:90/255.0 blue:41/255.0 alpha:1.0];
self.navigationItem.titleView = titleView;
}
titleView.text = title;
[titleView sizeToFit];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [MyAppDelegate.searchResultArray count];
// return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1; //changes
}
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
SearchResultCell *cell = [tableView dequeueReusableCellWithIdentifier:#"SearchResultCell"];
NSArray *tempSearchArray=[MyAppDelegate.searchResultArray objectAtIndex:indexPath.section];
if (cell == nil) {
NSArray *topLevelObject;
topLevelObject = [[NSBundle mainBundle] loadNibNamed:#"SearchResultCell" owner:self options:nil];
cell = [topLevelObject objectAtIndex:0];
}
NSLog(#"%#",[tempSearchArray objectAtIndex:0]);
cell.lblUsername.text = [tempSearchArray objectAtIndex:0];
cell.lblNumber.text = [NSString stringWithFormat:#"%#",[tempSearchArray objectAtIndex:1]];
if([tempSearchArray objectAtIndex:2]==[NSNull null])
{
NSLog(#"nullll");
cell.lblFirst_name.text=#"";
}
else{
cell.lblFirst_name.text = [tempSearchArray objectAtIndex:2];
}
cell.lblLast_name.text = [tempSearchArray objectAtIndex:3];
cell.lblEstablishment.text = #"E1123522";
if ([[[NSUserDefaults standardUserDefaults] valueForKey:#"UserLogedInType"] intValue] == LoginTypeFacebook) {
if ([[NSUserDefaults standardUserDefaults] objectForKey:#"FBUserLogedInProfileData"] != [NSNull null]) {
NSMutableDictionary *FBUserProfileData = [[NSMutableDictionary alloc] initWithDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:#"FBUserLogedInProfileData"]];
[cell.imgIcon setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:#"https://graph.facebook.com/%#/picture?width=100&height=100",[FBUserProfileData objectForKey:#"id"]]]
placeholderImage:[UIImage imageNamed:#"icon.png"]];
}
}
else {
if([[tempSearchArray objectAtIndex:6] boolValue]==1){
ASIFormDataRequest *_requestImage = [[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:URLGetImage]];
__unsafe_unretained ASIFormDataRequest *requestImage = _requestImage;
[requestImage setPostValue:[tempSearchArray objectAtIndex:4] forKey:#"user_id"];
[requestImage startAsynchronous];
[requestImage setCompletionBlock:^{
NSLog(#"proimage%#",[requestImage responseData]);
cell.imgIcon.image=[UIImage imageWithData:[requestImage responseData] scale:1.0f];
}];
}
else{
[cell.imgIcon setImage:[UIImage imageNamed:#"No_image.png"]];
}
}
cell.imgIcon.layer.cornerRadius = 3.0;
cell.imgIcon.layer.masksToBounds = YES;
DYRateView *rateView = [[DYRateView alloc] initWithFrame:CGRectMake(90, 75, 120, 20)
fullStar:[UIImage imageNamed:#"StarFullLarge.png"]
emptyStar:[UIImage imageNamed:#"StarEmptyLarge.png"]];
rateView.padding = 2;
rateView.rate =[[tempSearchArray objectAtIndex:5] floatValue];
//NSLog(#"rating value%f",[[tempSearchArray objectAtIndex:4] floatValue]);
rateView.alignment = RateViewAlignmentCenter;
rateView.editable = YES;
rateView.delegate = self;
rateView.editable = NO;
[cell addSubview:rateView];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
SearchedProfileViewController *profileVC=[[SearchedProfileViewController alloc]init];
profileVC.cellId=indexPath.section;
NSLog(#"%d",profileVC.cellId);
[self.navigationController pushViewController:profileVC animated:YES];
//[self presentViewController:profileVC animated:YES completion:nil];
}
- (void)rateView:(DYRateView *)rateView changedToNewRate:(NSNumber *)rate {
// self.rateLabel.text = [NSString stringWithFormat:#"Rate: %d", rate.intValue];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
#end
updated crash log:
Objective: {objective 0xda869f0: <1:568> + <1:0.5>*0xd982420.marker{id: 726} + <1:-0.5>*_UIParallaxDimmingView:0x1186bb10.Height{id: 707}}
2013-12-05 14:41:01.318 GratZeez[1567:3503] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<NSISEngine: 0xc67f090>{ Rows:
0xc67fa30.negError{id: 631} == 6 + -1*0xc67d5e0:IB auto generated at build time for view with fixed frame.marker{id: 495} + 1*0xc67fa30.posErrorMarker{id: 630}
0xc685ce0.posErrorMarker{id: 644} == 132 + 1*0xc68b900:IB auto generated at build time for view with fixed frame.marker{id: 509} + 1*0xc685ce0.negError{id: 645}
0xc6888b0.posErrorMarker{id: 658} == 106 + 1*0xc68b9c0:IB auto generated at build time for view with fixed frame.marker{id: 517} + 1*0xc6888b0.negError{id: 659}
0xc6888f0.posErrorMarker{id: 660} == 0 + 1*0xc67b5d0:IB auto generated at build time for view with fixed frame.marker{id: 519} + 1*0xc6888f0.negError{id: 661}
0xc69ffd0.posErrorMarker{id: 646} == 0 + 1*0xc68b930:IB auto generated at build time for view with fixed frame.marker{id: 511} + 1*0xc69ffd0.negError{id: 647}
0xc6b3200.posErrorMarker{id: 628} == 90 + 1*0xc67ace0:IB auto generated at build time for view with fixed frame.marker{id: 493} + 1*0xc6b3200.negError{id: 629}
0xc6b45d0.posErrorMarker{id: 636} == 114 + 1*0xc67d670:IB auto generated at build time for view with fixed frame.marker{id: 501} + 1*0xc6b45d0.negError{id: 637}
0xc6b4620.posErrorMarker{id: 638} == 0 + 1*0xc67d6a0:IB auto generated at build time for view with fixed frame.marker{id: 503} + 1*0xc6b4620.negError{id: 639}
0xc6b4dc0.posErrorMarker{id: 664} == 72 + 1*0xc67b660:IB auto generated at build time for view with fixed frame.marker{id: 525} + 1*0xc6b4dc0.negError{id: 665}
0xc6b4e00.posErrorMarker{id: 667} == 0 + 1*0xc67b690:IB auto generated at build time for view with fixed frame.marker{id: 527} + 1*0xc6b4e00.negError{id: 668}
0xd9707e0.posErrorMarker{id: 589} == 128 + 1*0xc6b34d0:IB auto generated at build time for view with fixed frame.marker{id: 553} + 1*0xd9707e0.negError{id: 590}
0xd970820.posErrorMarker{id: 591} == 0 + 1*0xc6b3500:IB auto generated at build time for view with fixed frame.marker{id: 555} + 1*0xd970820.negError{id: 592}
0xd974070.posErrorMarker{id: 585} == 104 + 1*0xc6b3410:IB auto generated at build time for view with fixed frame.marker{id: 545} + 1*0xd974070.negError{id: 586}
0xd977ca0.posErrorMarker{id: 632} == 90 + 1*0xc6b3650:IB auto generated at build time for view with fixed frame.marker{id: 569} + 1*0xd977ca0.negError{id: 633}
0xd977dd0.posErrorMarker{id: 634} == 0 + 1*0xc6b3680:IB auto generated at build time for view with fixed frame.marker{id: 571} + 1*0xd977dd0.negError{id: 635}
0xd97a6d0.negError{id: 588} == 6 + -1*0xc6b3440:IB auto generated at build time for view with fixed frame.marker{id: 547} + 1*0xd97a6d0.posErrorMarker{id: 587}
0xd97ac70.posErrorMarker{id: 640} == 72 + 1*0xc6b3710:IB auto generated at build time for view with fixed frame.marker{id: 577} + 1*0xd97ac70.negError{id: 641}
0xd97acd0.posErrorMarker{id: 642} == 0 + 1*0xc6b3740:IB auto generated at build time for view with fixed frame.marker{id: 579} + 1*0xd97acd0.negError{id: 643}
0xd97cfb0.posErrorMarker{id: 601} == 200 + 1*0xc6b3590:IB auto generated at build time for view with fixed frame.marker{id: 561} + 1*0xd97cfb0.negError{id: 602}
0xd97cff0.posErrorMarker{id: 603} == 42 + 1*0xc6b35c0:IB auto generated at build time for view with fixed frame.marker{id: 563} + 1*0xd97cff0.negError{id: 604}
SearchResultCell:0xc6ade20.Height{id: 652} == 200 + 1*0xd97b820.marker{id: 655}
SearchResultCell:0xc6ade20.Width{id: 650} == 640 + 2*0xd97b7c0.marker{id: 653} + 1*0xd97bd90.marker{id: 670}
SearchResultCell:0xc6ade20.minX{id: 649} == 0 + 2*0xd97b790.marker{id: 648} + -1*0xd97b7c0.marker{id: 653}
SearchResultCell:0xc6ade20.minY{id: 651} == 0 + 2*0xd97b7f0.marker{id: 654} + -0.5*0xd97b820.marker{id: 655}
SearchResultCell:0xc6b2fd0.Height{id: 617} == 200 + 1*0xc6a6a20.marker{id: 625}
SearchResultCell:0xc6b2fd0.Width{id: 614} == 640 + 2*0xc672a00.marker{id: 623} + 1*0xd97bd90.marker{id: 670}
SearchResultCell:0xc6b2fd0.minX{id: 620} == 0 + 2*0xc6a03a0.marker{id: 619} + -1*0xc672a00.marker{id: 623}
SearchResultCell:0xc6b2fd0.minY{id: 621} == 200 + 2*0xc673060.marker{id: 624} + -0.5*0xc6a6a20.marker{id: 625}
UIImageView:0xc67faa0.Height{id: 540} == 150 + 1*0xc6b3380:IB auto generated at build time for view with fixed frame.marker{id: 539}
UIImageView:0xc67faa0.Width{id: 538} == 150 + 1*0xc6b3350:IB auto generated at build time for view with fixed frame.marker{id: 537}
UIImageView:0xc67faa0.minX{id: 534} == 20 + 1*0xc6b32a0:IB auto generated at build time for view with fixed frame.marker{id: 533}
UIImageView:0xc67faa0.minY{id: 536} == 24 + 1*0xc6b3320:IB auto generated at build time for view with fixed frame.marker{id: 535}
UIImageView:0xc696c80.Height{id: 488} == 150 + 1*0xc67ac50:IB auto generated at build time for view with fixed frame.marker{id: 487}
UIImageView:0xc696c80.Width{id: 486} == 150 + 1*0xc67ac20:IB auto generated at build time for view with fixed frame.marker{id: 485}
UIImageView:0xc696c80.minX{id: 482} == 20 + 1*0xc699a30:IB auto generated at build time for view with fixed frame.marker{id: 481}
UIImageView:0xc696c80.minY{id: 484} == 24 + 1*0xc699ab0:IB auto generated at build time for view with fixed frame.marker{id: 483}
UILabel:0xc6732d0.Height{id: 548} == 42 + 1*0xc6b3440:IB auto generated at build time for view with fixed frame.marker{id: 547}
UILabel:0xc6732d0.Width{id: 546} == 434 + 1*0xc6b3410:IB auto generated at build time for view with fixed frame.marker{id: 545}
UILabel:0xc6732d0.minX{id: 542} == 186 + 1*0xc6b33b0:IB auto generated at build time for view with fixed frame.marker{id: 541}
UILabel:0xc6732d0.minY{id: 544} == 20 + 1*0xc6b33e0:IB auto generated at build time for view with fixed frame.marker{id: 543}
UILabel:0xc67bf90.Height{id: 564} == 42 + 1*0xc6b35c0:IB auto generated at build time for view with fixed frame.marker{id: 563}
UILabel:0xc67bf90.Width{id: 562} == 200 + 1*0xc6b3590:IB auto generated at build time for view with fixed frame.marker{id: 561}
UILabel:0xc67bf90.minX{id: 558} == 420 + 1*0xc6b3530:IB auto generated at build time for view with fixed frame.marker{id: 557}
UILabel:0xc67bf90.minY{id: 560} == 68 + 1*0xc6b3560:IB auto generated at build time for view with fixed frame.marker{id: 559}
UILabel:0xc67d490.Height{id: 572} == 42 + 1*0xc6b3680:IB auto generated at build time for view with fixed frame.marker{id: 571}
UILabel:0xc67d490.Width{id: 570} == 200 + 1*0xc6b3650:IB auto generated at build time for view with fixed frame.marker{id: 569}
UILabel:0xc67d490.minX{id: 566} == 186 + 1*0xc6b35f0:IB auto generated at build time for view with fixed frame.marker{id: 565}
UILabel:0xc67d490.minY{id: 568} == 106 + 1*0xc6b3620:IB auto generated at build time for view with fixed frame.marker{id: 567}
UILabel:0xc67d840.Height{id: 512} == 42 + 1*0xc68b930:IB auto generated at build time for view with fixed frame.marker{id: 511}
UILabel:0xc67d840.Width{id: 510} == 200 + 1*0xc68b900:IB auto generated at build time for view with fixed frame.marker{id: 509}
UILabel:0xc67d840.minX{id: 506} == 420 + 1*0xc67d6d0:IB auto generated at build time for view with fixed frame.marker{id: 505}
UILabel:0xc67d840.minY{id: 508} == 68 + 1*0xc68b8d0:IB auto generated at build time for view with fixed frame.marker{id: 507}
UILabel:0xc681210.Height{id: 504} == 42 + 1*0xc67d6a0:IB auto generated at build time for view with fixed frame.marker{id: 503}
UILabel:0xc681210.Width{id: 502} == 200 + 1*0xc67d670:IB auto generated at build time for view with fixed frame.marker{id: 501}
UILabel:0xc681210.minX{id: 498} == 186 + 1*0xc67d610:IB auto generated at build time for view with fixed frame.marker{id: 497}
UILabel:0xc681210.minY{id: 500} == 68 + 1*0xc67d640:IB auto generated at build time for view with fixed frame.marker{id: 499}
UILabel:0xc683e20.Height{id: 520} == 42 + 1*0xc67b5d0:IB auto generated at build time for view with fixed frame.marker{id: 519}
UILabel:0xc683e20.Width{id: 518} == 200 + 1*0xc68b9c0:IB auto generated at build time for view with fixed frame.marker{id: 517}
UILabel:0xc683e20.minX{id: 514} == 186 + 1*0xc68b960:IB auto generated at build time for view with fixed frame.marker{id: 513}
UILabel:0xc683e20.minY{id: 516} == 106 + 1*0xc68b990:IB auto generated at build time for view with fixed frame.marker{id: 515}
UILabel:0xc685a40.Height{id: 556} == 42 + 1*0xc6b3500:IB auto generated at build time for view with fixed frame.marker{id: 555}
UILabel:0xc685a40.Width{id: 554} == 200 + 1*0xc6b34d0:IB auto generated at build time for view with fixed frame.marker{id: 553}
UILabel:0xc685a40.minX{id: 550} == 186 + 1*0xc6b3470:IB auto generated at build time for view with fixed frame.marker{id: 549}
UILabel:0xc685a40.minY{id: 552} == 68 + 1*0xc6b34a0:IB auto generated at build time for view with fixed frame.marker{id: 551}
UILabel:0xc686460.Height{id: 580} == 42 + 1*0xc6b3740:IB auto generated at build time for view with fixed frame.marker{id: 579}
UILabel:0xc686460.Width{id: 578} == 200 + 1*0xc6b3710:IB auto generated at build time for view with fixed frame.marker{id: 577}
UILabel:0xc686460.minX{id: 574} == 420 + 1*0xc6b36b0:IB auto generated at build time for view with fixed frame.marker{id: 573}
UILabel:0xc686460.minY{id: 576} == 106 + 1*0xc6b36e0:IB auto generated at build time for view with fixed frame.marker{id: 575}
UILabel:0xc68a640.Height{id: 528} == 42 + 1*0xc67b690:IB auto generated at build time for view with fixed frame.marker{id: 527}
UILabel:0xc68a640.Width{id: 526} == 200 + 1*0xc67b660:IB auto generated at build time for view with fixed frame.marker{id: 525}
UILabel:0xc68a640.minX{id: 522} == 420 + 1*0xc67b600:IB auto generated at build time for view with fixed frame.marker{id: 521}
UILabel:0xc68a640.minY{id: 524} == 106 + 1*0xc67b630:IB auto generated at build time for view with fixed frame.marker{id: 523}
UILabel:0xc68c5d0.Height{id: 496} == 42 + 1*0xc67d5e0:IB auto generated at build time for view with fixed frame.marker{id: 495}
UILabel:0xc68c5d0.Width{id: 494} == 434 + 1*0xc67ace0:IB auto generated at build time for view with fixed frame.marker{id: 493}
UILabel:0xc68c5d0.minX{id: 490} == 186 + 1*0xc67ac80:IB auto generated at build time for view with fixed frame.marker{id: 489}
UILabel:0xc68c5d0.minY{id: 492} == 20 + 1*0xc67acb0:IB auto generated at build time for view with fixed frame.marker{id: 491}
UILayoutContainerView:0xc670770.Height{id: 393} == 1136 + 1*0xc685240:UIView-Encapsulated-Layout-Height.marker{id: 398}
UILayoutContainerView:0xc670770.Width{id: 390} == 640 + 1*0xc685210:UIView-Encapsulated-Layout-Width.marker{id: 395}
UINavigationTransitionView:0xc6720e0.Height{id: 389} == 1136 + 2*0xc6844d0.marker{id: 394} + 1*0xc685240:UIView-Encapsulated-Layout-Height.marker{id: 398}
UINavigationTransitionView:0xc6720e0.Width{id: 387} == 640 + 2*0xc684430.marker{id: 391} + 1*0xc685210:UIView-Encapsulated-Layout-Width.marker{id: 395}
UINavigationTransitionView:0xc6720e0.minX{id: 386} == 0 + 2*0xc684400.marker{id: 385} + -1*0xc684430.marker{id: 391}
UINavigationTransitionView:0xc6720e0.minY{id: 388} == 0 + 2*0xc6844a0.marker{id: 392} + -1*0xc6844d0.marker{id: 394}
UITableView:0x14a40a00.Height{id: 701} == 0 + 1*_UIParallaxDimmingView:0x1186bb10.Height{id: 707} + 2*0xd97c220.marker{id: 710}
UITableView:0x14a40a00.Width{id: 699} == 640 + 2*0xd97c1c0.marker{id: 703} + 1*0xd9823c0.marker{id: 719} + -2*tempToBeOptimizedToZero{id: 720}
UITableView:0x14a40a00.contentHeight{id: 480} == 400 + 1*0xc6ad9c0.marker{id: 479}
UITableView:0x14a40a00.contentWidth{id: 478} == 640 + 1*0xc6ad980.marker{id: 477}
UITableView:0x14a40a00.minX{id: 698} == 0 + 2*0xd97c190.marker{id: 697} + -1*0xd97c1c0.marker{id: 703}
UITableView:0x14a40a00.minY{id: 700} == 0 + 2*0xd97c1f0.marker{id: 705} + -1*0xd97c220.marker{id: 710}
UITableViewCellContentView:0xc67b900.Height{id: 677} == 199 + 1*0xc6b51c0.marker{id: 683}
UITableViewCellContentView:0xc67b900.Width{id: 675} == 640 + 1*0xc6b5160.marker{id: 678}
UITableViewCellContentView:0xc67b900.minX{id: 674} == 0 + 2*0xc6b5130.marker{id: 673} + -0.5*0xc6b5160.marker{id: 678}
UITableViewCellContentView:0xc67b900.minY{id: 676} == 0 + 2*0xc6b5190.marker{id: 681} + -0.5*0xc6b51c0.marker{id: 683}
UITableViewCellContentView:0xc6a7d10.Height{id: 597} == 199 + 1*0xc6ae810.marker{id: 606}
UITableViewCellContentView:0xc6a7d10.Width{id: 595} == 640 + 1*0xc6ae700.marker{id: 598}
UITableViewCellContentView:0xc6a7d10.minX{id: 594} == 0 + 2*0xc6ae660.marker{id: 593} + -0.5*0xc6ae700.marker{id: 598}
UITableViewCellContentView:0xc6a7d10.minY{id: 596} == 0 + 2*0xc6ae750.marker{id: 605} + -0.5*0xc6ae810.marker{id: 606}
UITableViewCellScrollView:0xc6aeb60.Height{id: 693} == 200 + 1*0xd97b820.marker{id: 655} + 2*0xc6b5c10.marker{id: 706}
UITableViewCellScrollView:0xc6aeb60.Width{id: 691} == 640 + 2*0xd97b7c0.marker{id: 653} + 1*0xd97bd90.marker{id: 670} + 2*0xc6b5bb0.marker{id: 694}
UITableViewCellScrollView:0xc6aeb60.contentHeight{id: 532} == 200 + 1*0xc68c560.marker{id: 531}
UITableViewCellScrollView:0xc6aeb60.contentWidth{id: 530} == 640 + 1*0xc68c4c0.marker{id: 529}
UITableViewCellScrollView:0xc6aeb60.minX{id: 690} == 0 + 2*0xc6b5d00.marker{id: 689} + -1*0xc6b5bb0.marker{id: 694}
UITableViewCellScrollView:0xc6aeb60.minY{id: 692} == 0 + 2*0xc6b5be0.marker{id: 704} + -1*0xc6b5c10.marker{id: 706}
UITableViewCellScrollView:0xc6b3880.Height{id: 613} == 200 + 2*0xc6b2480.marker{id: 618} + 1*0xc6a6a20.marker{id: 625}
UITableViewCellScrollView:0xc6b3880.Width{id: 611} == 640 + 2*0xc6b22e0.marker{id: 615} + 2*0xc672a00.marker{id: 623} + 1*0xd97bd90.marker{id: 670}
UITableViewCellScrollView:0xc6b3880.contentHeight{id: 584} == 200 + 1*0xc6b3ce0.marker{id: 583}
UITableViewCellScrollView:0xc6b3880.contentWidth{id: 582} == 640 + 1*0xc6b37d0.marker{id: 581}
UITableViewCellScrollView:0xc6b3880.minX{id: 610} == 0 + 2*0xc6b2220.marker{id: 609} + -1*0xc6b22e0.marker{id: 615}
UITableViewCellScrollView:0xc6b3880.minY{id: 612} == 0 + 2*0xc6b23b0.marker{id: 616} + -1*0xc6b2480.marker{id: 618}
UITableViewWrapperView:0x1186b2c0.Height{id: 669} == 1136 + 1*0xd97bdf0.marker{id: 686}
UITableViewWrapperView:0x1186b2c0.Width{id: 622} == 640 + 1*0xd97bd90.marker{id: 670}
UITableViewWrapperView:0x1186b2c0.minX{id: 663} == 0 + 2*0xd97bd60.marker{id: 662} + -0.5*0xd97bd90.marker{id: 670}
UITableViewWrapperView:0x1186b2c0.minY{id: 666} == 0 + 2*0xd97bdc0.marker{id: 682} + -0.5*0xd97bdf0.marker{id: 686}
UIView:0xc674820.Height{id: 453} == 1136 + 1*0xc679f40.marker{id: 474}
UIView:0xc674820.Width{id: 451} == 640 + 1*0xc69ff70.marker{id: 470}
UIView:0xc674820.minX{id: 450} == -192 + 2*0xc69ff40.marker{id: 469} + -0.5*0xc69ff70.marker{id: 470}
UIView:0xc674820.minY{id: 452} == 0 + 2*0xc69ffa0.marker{id: 473} + -0.5*0xc679f40.marker{id: 474}
UIView:0xc6752d0.Height{id: 718} == 1136 + 1*0xd982620.marker{id: 730}
UIView:0xc6752d0.Width{id: 716} == 640 + 1*0xd9825c0.marker{id: 722}
UIView:0xc6752d0.minX{id: 715} == 0 + 2*0xd982580.marker{id: 714} + -0.5*0xd9825c0.marker{id: 722}
UIView:0xc6752d0.minY{id: 717} == 0 + 2*0xd9825f0.marker{id: 729} + -0.5*0xd982620.marker{id: 730}
UIViewControllerWrapperView:0xc687700.Height{id: 377} == 1136 + 1*0xc683fa0.marker{id: 382}
UIViewControllerWrapperView:0xc687700.Width{id: 375} == 640 + 1*0xc683f00.marker{id: 378}
UIViewControllerWrapperView:0xc687700.minX{id: 374} == 0 + 2*0xc683ed0.marker{id: 373} + -0.5*0xc683f00.marker{id: 378}
UIViewControllerWrapperView:0xc687700.minY{id: 376} == 0 + 2*0xc683f70.marker{id: 381} + -0.5*0xc683fa0.marker{id: 382}
_UIParallaxDimmingView:0x1186bb10.Width{id: 702} == 640 + 1*0xd9823c0.marker{id: 719}
_UIParallaxDimmingView:0x1186bb10.minX{id: 712} == 0 + 2*0xd982390.marker{id: 711} + -0.5*0xd9823c0.marker{id: 719} + 1*tempToBeOptimizedToZero{id: 720}
_UIParallaxDimmingView:0x1186bb10.minY{id: 713} == 568 + -0.5*_UIParallaxDimmingView:0x1186bb10.Height{id: 707} + 2*0xd9823f0.marker{id: 725}
objective{id: 243} == {objective 0xc67e090: <750:12, 251:1150> + <251:1>*0xc67ace0:IB auto generated at build time for view with fixed frame.marker{id: 493} + <251:1>*0xc67b5d0:IB auto generated at build time for view with fixed frame.marker{id: 519} + <251:1>*0xc67b660:IB auto generated at build time for view with fixed frame.marker{id: 525} + <251:1>*0xc67b690:IB auto generated at build time for view with fixed frame.marker{id: 527} + <750:-1>*0xc67d5e0:IB auto generated at build time for view with fixed frame.marker{id: 495} + <251:1>*0xc67d670:IB auto generated at build time for view with fixed frame.marker{id: 501} + <251:1>*0xc67d6a0:IB auto generated at build time for view with fixed frame.marker{id: 503} + <750:1, 251:1>*0xc67fa30.posErrorMarker{id: 630} + <750:1, 251:1>*0xc685ce0.negError{id: 645} + <750:1, 251:1>*0xc6888b0.negError{id: 659} + <750:1, 251:1>*0xc6888f0.negError{id: 661} + <251:1>*0xc68b900:IB auto generated at build time for view with fixed frame.marker{id: 509} + <251:1>*0xc68b930:IB auto generated at build time for view with fixed frame.marker{id: 511} + <251:1>*0xc68b9c0:IB auto generated at build time for view with fixed frame.marker{id: 517} + <750:1, 251:1>*0xc69ffd0.negError{id: 647} + <750:1, 251:1>*0xc6b3200.negError{id: 629} + <251:1>*0xc6b3410:IB auto generated at build time for view with fixed frame.marker{id: 545} + <750:-1>*0xc6b3440:IB auto generated at build time for view with fixed frame.marker{id: 547} + <251:1>*0xc6b34d0:IB auto generated at build time for view with fixed frame.marker{id: 553} + <251:1>*0xc6b3500:IB auto generated at build time for view with fixed frame.marker{id: 555} + <251:1>*0xc6b3590:IB auto generated at build time for view with fixed frame.marker{id: 561} + <251:1>*0xc6b35c0:IB auto generated at build time for view with fixed frame.marker{id: 563} + <251:1>*0xc6b3650:IB auto generated at build time for view with fixed frame.marker{id: 569} + <251:1>*0xc6b3680:IB auto generated at build time for view with fixed frame.marker{id: 571} + <251:1>*0xc6b3710:IB auto generated at build time for view with fixed frame.marker{id: 577} + <251:1>*0xc6b3740:IB auto generated at build time for view with fixed frame.marker{id: 579} + <750:1, 251:1>*0xc6b45d0.negError{id: 637} + <750:1, 251:1>*0xc6b4620.negError{id: 639} + <750:1, 251:1>*0xc6b4dc0.negError{id: 665} + <750:1, 251:1>*0xc6b4e00.negError{id: 668} + <750:1, 251:1>*0xd9707e0.negError{id: 590} + <750:1, 251:1>*0xd970820.negError{id: 592} + <750:1, 251:1>*0xd974070.negError{id: 586} + <750:1, 251:1>*0xd977ca0.negError{id: 633} + <750:1, 251:1>*0xd977dd0.negError{id: 635} + <750:1, 251:1>*0xd97a6d0.posErrorMarker{id: 587} + <750:1, 251:1>*0xd97ac70.negError{id: 641} + <750:1, 251:1>*0xd97acd0.negError{id: 643} + <750:1, 251:1>*0xd97cfb0.negError{id: 602} + <750:1, 251:1>*0xd97cff0.negError{id: 604}}
tempToBeOptimizedToZeroObjective{id: 728} == {objective 0xda869f0: <1:568> + <1:0.5>*0xd982420.marker{id: 726} + <1:-0.5>*_UIParallaxDimmingView:0x1186bb10.Height{id: 707}}
tempToBeOptimizedToZero{id: 727} == 568 + -0.5*_UIParallaxDimmingView:0x1186bb10.Height{id: 707} + 0.5*0xd982420.marker{id: 726}
Constraints:
<NSAutoresizingMaskLayoutConstraint:0xc672a00 h=-&- v=--& SearchResultCell:0xc6b2fd0.width == UITableViewWrapperView:0x1186b2c0.width> Marker:0xc672a00.marker{id: 623}
<NSAutoresizingMaskLayoutConstraint:0xc673060 h=-&- v=--& SearchResultCell:0xc6b2fd0.midY == + 150> Marker:0xc673060.marker{id: 624}
<NSAutoresizingMaskLayoutConstraint:0xc679f40 h=--& v=--& V:[UIView:0xc674820(568)]> Marker:0xc679f40.marker{id: 474}
<NSAutoresizingMaskLayoutConstraint:0xc683ed0 h=--& v=--& UIViewControllerWrapperView:0xc687700.midX == + 160> Marker:0xc683ed0.marker{id: 373}
<NSAutoresizingMaskLayoutConstraint:0xc683f00 h=--& v=--& H:[UIViewControllerWrapperView:0xc687700(320)]> Marker:0xc683f00.marker{id: 378}
<NSAutoresizingMaskLayoutConstraint:0xc683f70 h=--& v=--& UIViewControllerWrapperView:0xc687700.midY == + 284> Marker:0xc683f70.marker{id: 381}
<NSAutoresizingMaskLayoutConstraint:0xc683fa0 h=--& v=--& V:[UIViewControllerWrapperView:0xc687700(568)]> Marker:0xc683fa0.marker{id: 382}
<NSAutoresizingMaskLayoutConstraint:0xc684400 h=-&- v=-&- UINavigationTransitionView:0xc6720e0.midX == UILayoutContainerView:0xc670770.midX> Marker:0xc684400.marker{id: 385}
<NSAutoresizingMaskLayoutConstraint:0xc684430 h=-&- v=-&- UINavigationTransitionView:0xc6720e0.width == UILayoutContainerView:0xc670770.width> Marker:0xc684430.marker{id: 391}
<NSAutoresizingMaskLayoutConstraint:0xc6844a0 h=-&- v=-&- UINavigationTransitionView:0xc6720e0.midY == UILayoutContainerView:0xc670770.midY> Marker:0xc6844a0.marker{id: 392}
<NSAutoresizingMaskLayoutConstraint:0xc6844d0 h=-&- v=-&- UINavigationTransitionView:0xc6720e0.height == UILayoutContainerView:0xc670770.height> Marker:0xc6844d0.marker{id: 394}
<NSAutoresizingMaskLayoutConstraint:0xc69ff40 h=--& v=--& UIView:0xc674820.midX == + 64> Marker:0xc69ff40.marker{id: 469}
<NSAutoresizingMaskLayoutConstraint:0xc69ff70 h=--& v=--& H:[UIView:0xc674820(320)]> Marker:0xc69ff70.marker{id: 470}
<NSAutoresizingMaskLayoutConstraint:0xc69ffa0 h=--& v=--& UIView:0xc674820.midY == + 284> Marker:0xc69ffa0.marker{id: 473}
<NSAutoresizingMaskLayoutConstraint:0xc6a03a0 h=-&- v=--& SearchResultCell:0xc6b2fd0.midX == UITableViewWrapperView:0x1186b2c0.midX> Marker:0xc6a03a0.marker{id: 619}
<NSAutoresizingMaskLayoutConstraint:0xc6a6a20 h=-&- v=--& V:[SearchResultCell:0xc6b2fd0(100)]> Marker:0xc6a6a20.marker{id: 625}
<NSAutoresizingMaskLayoutConstraint:0xc6ae660 h=--& v=--& UITableViewCellContentView:0xc6a7d10.midX == + 160> Marker:0xc6ae660.marker{id: 593}
and many more log about autoresizing and contentsize
It means your mutable NSSet is changed while enumerating.
OK, After checking your code, you have unsafe code. You are using MyAppDelegate.searchResultArray as datasource of your table. That is the point sometimes causing you crash.
Just think about what if MyAppDelegate.searchResultArray is changed while UITableView is loading?
You should make sure your data source should be static while loading table view. Better set it on the same class which is your ViewController.
I have this problem with NSLayoutConstraint and multiplier in ios 7, ios 8 work perfect.
I m using multipler whit value 0.2 and cause errors!! Alter value multipler for 1 and get size screen in constant value to nslayoutconstraint.
NSLayoutConstraint(item: BT_Facebook, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 0.2 , constant: sizeBtRedeSociais)
Solution is usage size of screen, and not percent.
var sizeBtRedeSociais = UIScreen.mainScreen().bounds.width / 5
var BT_FacebookWidth = NSLayoutConstraint(item: BT_Facebook, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)
var BT_TwitterWidth = NSLayoutConstraint(item: BT_Twitter, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)
var BT_InstagramWidth = NSLayoutConstraint(item: BT_Instagram, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)
var BT_GoogleWidth = NSLayoutConstraint(item: BT_Google, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)
var BT_YoutubeWidth = NSLayoutConstraint(item: BT_Youtube, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)

Obj-C: dispatch_async crashes without NSLog

for some reason i have a dispatch_async thread, and it crashes unless i have a NSLog() method executed in front of it. the block runs a method that retrieves a username from a database.
crash:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
user_web_communicator *usrWeb = [[user_web_communicator alloc]init];
NSString *author = [usrWeb getUsernameFromID:author_string];
[_author_label setText:[NSString stringWithFormat:#"Author: %#",author]];
});
working:
NSLog(#"Fetching author for id: %#",author_string);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
user_web_communicator *usrWeb = [[user_web_communicator alloc]init];
NSString *author = [usrWeb getUsernameFromID:author_string];
[_author_label setText:[NSString stringWithFormat:#"Author: %#",author]];
});
error
2013-08-19 13:56:06.149 Poll Me[4995:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '{
Rows: AsyncImageView:0x827aa00.minX == 10 + 1*0x827b8d0.marker +
-1*0x8281210.marker + 0.5*0x8281260.marker AsyncImageView:0x827aa00.minY == 27.5 + -1*0x827b910.marker +
-1*0x82812a0.marker + 0.5*0x82812e0.marker + 0.5*0x82823f0.marker + -0.5*AsyncImageView:0x827aa00.Height Regular_Cell:0x827a400.Height == 56 + 1*0x82823f0.marker Regular_Cell:0x827a400.Width == 320 +
1*0x8281ee0.marker Regular_Cell:0x827a400.minX == 0 +
1*0x8281740.marker + -0.5*0x8281ee0.marker
Regular_Cell:0x827a400.minY == 46 + 1*0x8281b30.marker +
-0.5*0x82823f0.marker UILabel:0x827a8e0.Width == 0 + 1*0x827b730.marker + 1*0x827b790.marker + -1*0x827b7d0.marker +
1*UILabel:0x827adc0.Width UILabel:0x827a8e0.minX == 18 +
1*0x827b7d0.marker + 1*0x827b8d0.marker + -1*0x8281210.marker +
0.5*0x8281260.marker + 1*AsyncImageView:0x827aa00.Width UILabel:0x827a8e0.minY == 19.5 + -1*0x827b810.marker +
1*0x827b890.marker + -1*0x827b910.marker + -1*0x82812a0.marker +
0.5*0x82812e0.marker + 0.5*0x82823f0.marker + 0.5*AsyncImageView:0x827aa00.Height + -1*UILabel:0x827a8e0.Height + -1*UILabel:0x827b140.Height UILabel:0x827adc0.minX == 18 + 1*0x827b730.marker + 1*0x827b8d0.marker + -1*0x8281210.marker +
0.5*0x8281260.marker + 1*AsyncImageView:0x827aa00.Width UILabel:0x827adc0.minY == 20.5 + 1*0x827b6f0.marker +
-1*0x82812a0.marker + 0.5*0x82812e0.marker UILabel:0x827b140.minX == 18 + 1*0x827b850.marker + 1*0x827b8d0.marker + -1*0x8281210.marker +
0.5*0x8281260.marker + 1*AsyncImageView:0x827aa00.Width UILabel:0x827b140.minY == 27.5 + 1*0x827b890.marker +
-1*0x827b910.marker + -1*0x82812a0.marker + 0.5*0x82812e0.marker + 0.5*0x82823f0.marker + 0.5*AsyncImageView:0x827aa00.Height + -1*UILabel:0x827b140.Height UITableViewCellContentView:0x827a560.Height == 55 +
1*0x82812e0.marker UITableViewCellContentView:0x827a560.Width == 300
+ 1*0x8281260.marker UITableViewCellContentView:0x827a560.minX == 0 + 1*0x8281210.marker + -0.5*0x8281260.marker
UITableViewCellContentView:0x827a560.minY == 0.5 + 1*0x82812a0.marker
+ -0.5*0x82812e0.marker objective == <> + <750:-1>*0x8280fc0.negError + <250:-1>*0x8280fc0.posErrorMarker + <750:-1>*0x8281030.negError + <250:-1>*0x8281030.posErrorMarker
Constraints: Marker:0x8281210.marker
Marker:0x8281260.marker
Marker:0x82812a0.marker (Integralization adjustment:0.5) Marker:0x82812e0.marker
Marker:0x8281740.marker
Marker:0x8281b30.marker
Marker:0x8280fc0.posErrorMarker
Marker:0x8281030.posErrorMarker
Marker:0x827b6f0.marker
Marker:0x827b730.marker
Marker:0x827b790.marker
Marker:0x827b7d0.marker
Marker:0x827b810.marker
Marker:0x827b850.marker
Marker:0x827b890.marker
Marker:0x827b8d0.marker
Marker:0x827b910.marker
Marker:0x8281ee0.marker
Marker:0x82823f0.marker }: internal
error. Cannot find an outgoing row head for incoming head
0x8280fc0.negError, which should never happen.'
* First throw call stack: (0x195d012 0x166ae7e 0x195cdeb 0xefef89 0xf01fcf 0xf025c7 0xf0d58f 0xf0d6d4 0x7d860a 0x7e02af 0x7e03be
0x2e7601 0x49484e 0x354ced 0x2e940c 0x354a7b 0x359919 0x3599cf
0x3421bb 0x352b4b 0x2ef2dd 0x167e6b0 0x17dfc0 0x17233c 0x172150
0xf00bc 0xf1227 0xf18e2 0x1925afe 0x1925a3d 0x19037c2 0x1902f44
0x1902e1b 0x29be7e3 0x29be668 0x29effc 0x1e5ed 0x1d75) 2013-08-19
13:56:06.149 Poll Me[4995:4f03] * Terminating app due to uncaught
exception 'NSInternalInconsistencyException', reason: '{ Rows:
AsyncImageView:0x827aa00.minX == 10 + 1*0x827b8d0.marker +
-1*0x8281210.marker + 0.5*0x8281260.marker AsyncImageView:0x827aa00.minY == 27.5 + -1*0x827b910.marker +
-1*0x82812a0.marker + 0.5*0x82812e0.marker + 0.5*0x82823f0.marker + -0.5*AsyncImageView:0x827aa00.Height Regular_Cell:0x827a400.Height == 56 + 1*0x82823f0.marker Regular_Cell:0x827a400.Width == 320 +
1*0x8281ee0.marker Regular_Cell:0x827a400.minX == 0 +
1*0x8281740.marker + -0.5*0x8281ee0.marker
Regular_Cell:0x827a400.minY == 46 + 1*0x8281b30.marker +
-0.5*0x82823f0.marker UILabel:0x827a8e0.Width == 0 + 1*0x827b730.marker + 1*0x827b790.marker + -1*0x827b7d0.marker +
1*UILabel:0x827adc0.Width UILabel:0x827a8e0.minX == 18 +
1*0x827b7d0.marker + 1*0x827b8d0.marker + -1*0x8281210.marker +
0.5*0x8281260.marker + 1*AsyncImageView:0x827aa00.Width UILabel:0x827a8e0.minY == 19.5 + -1*0x827b810.marker +
1*0x827b890.marker + -1*0x827b910.marker + -1*0x82812a0.marker +
0.5*0x82812e0.marker + 0.5*0x82823f0.marker + 0.5*AsyncImageView:0x827aa00.Height + -1*UILabel:0x827a8e0.Height + -1*UILabel:0x827b140.Height UILabel:0x827adc0.minX == 18 + 1*0x827b730.marker + 1*0x827b8d0.marker + -1*0x8281210.marker +
0.5*0x8281260.marker + 1*AsyncImageView:0x827aa00.Width UILabel:0x827adc0.minY == 20.5 + 1*0x827b6f0.marker +
-1*0x82812a0.marker + 0.5*0x82812e0.marker UILabel:0x827b140.minX == 18 + 1*0x827b850.marker + 1*0x827b8d0.marker + -1*0x8281210.marker +
0.5*0x8281260.marker + 1*AsyncImageView:0x827aa00.Width UILabel:0x827b140.minY == 27.5 + 1*0x827b890.marker +
-1*0x827b910.marker + -1*0x82812a0.marker + 0.5*0x82812e0.marker + 0.5*0x82823f0.marker + 0.5*AsyncImageView:0x827aa00.Height + -1*UILabel:0x827b140.Height UITableViewCellContentView:0x827a560.Height == 55 +
1*0x82812e0.marker UITableViewCellContentView:0x827a560.Width == 300
+ 1*0x8281260.marker UITableViewCellContentView:0xlibc++abi.dylib: terminate called throwing an exception827a560.minX == 0 +
1*0x8281210.marker + -0.5*0x8281260.marker
UITableViewCellContentView:0x827a560.minY == 0.5 + 1*0x82812a0.marker
+ -0.5*0x82812e0.marker objective == <> + <750:-1>*0x8280fc0.negError + <250:-1>*0x8280fc0.posErrorMarker + <750:-1>*0x8281030.negError + <250:-1>*0x8281030.posErrorMarker
Constraints: Marker:0x8281210.marker
Marker:0x8281260.marker
Marker:0x82812a0.marker (Integralization adjustment:0.5) Marker:0x82812e0.marker
Marker:0x8281740.marker Marker:0x8281b30.marker
Marker:0x8280fc0.posErrorMarker
Marker:0x8281030.posErrorMarker
Marker:0x827b6f0.marker
Marker:0x827b730.marker
Marker:0x827b790.marker
Marker:0x827b7d0.marker
Marker:0x827b810.marker
Marker:0x827b850.marker
Marker:0x827b890.marker
Marker:0x827b8d0.marker
Marker:0x827b910.marker
Marker:0x8281ee0.marker
Marker:0x82823f0.marker }: internal
error. Cannot find an outgoing row head for incoming head
0x8280fc0.negError, which should never happen.'
* First throw call stack: (0x195d012 0x166ae7e 0x195cdeb 0xefef89 0xf01fcf 0xf020d3 0x7d86dc 0x7d9280 0x7dd4a3 0x3f7e3c 0x3f8022
0x3f8064 0x2f33b 0x277553f 0x2787014 0x27782e8 0x2778450 0x92710e72
0x926f8d2a) (lldb)
can you please tell me why this could be happening? i dont want to keep the NSLog() there because it runs it several times and gets in the way when trying to read output. Thank you in advance =)
It is undefined behavior to set the text property of a label in a background thread, or any other UI changes for that matter. Since it is undefined behavior I can not explain why it works with the NSLog but you need to dispatch setting the label's text to the main thread.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
user_web_communicator *usrWeb = [[user_web_communicator alloc]init];
NSString *author = [usrWeb getUsernameFromID:author_string];
dispatch_sync(dispatch_get_main_queue(), ^{
[_author_label setText:[NSString stringWithFormat:#"Author: %#",author]];
})
});

Resources