wordpress-mobile / MediaPicker-iOS

WPMediaPicker is an iOS controller that allows capture and picking of media assets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when editing albums on the Photos app with picker open.

rogomantik opened this issue · comments

Someone can rewrite it in swift?

Any specific reason for that? I've been using the component on a Swift codebase and it's working great.

The reason is strictly subjective
I have trouble with objective c syntax

I got this error

This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
Stack:(
0 CoreFoundation 0x00000001066d1d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010613321e objc_exception_throw + 48
2 CoreFoundation 0x000000010673b2b5 +[NSException raise:format:] + 197
3 Foundation 0x0000000105e2d06c _AssertAutolayoutOnAllowedThreadsOnly + 180
4 Foundation 0x0000000105c4e334 -[NSISEngine withBehaviors:performModifications:] + 31
5 UIKit 0x000000010466dc30 -[UIView(AdditionalLayoutSupport) _recursiveUpdateConstraintsIfNeededCollectingViews:forSecondPass:] + 118
6 UIKit 0x000000010466d938 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 697
7 UIKit 0x000000010466e2a2 __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 91
8 UIKit 0x000000010466d0d0 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 117
9 UIKit 0x000000010466dd99 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 185
10 UIKit 0x000000010466ef2e -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 352
11 UIKit 0x0000000103d4d25a -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 159
12 UIKit 0x0000000103d5eaf2 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1295
13 QuartzCore 0x00000001080b0bf8 -[CALayer layoutSublayers] + 146
14 QuartzCore 0x00000001080a4440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
15 UIKit 0x0000000103d4c928 -[UIView(Hierarchy) layoutBelowIfNeeded] + 1509
16 UIKit 0x0000000103d53239 +[UIView(Animation) performWithoutAnimation:] + 90
17 UIKit 0x0000000103e07718 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1161
18 UIKit 0x0000000103e077e2 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74
19 UIKit 0x0000000103ddb2b0 -[UITableView _updateVisibleCellsNow:isRecursive:] + 3295
20 UIKit 0x0000000103e10b64 -[UITableView _performWithCachedTraitCollection:] + 110
21 UIKit 0x0000000103df73be -[UITableView layoutSubviews] + 222
22 UIKit 0x0000000103d5eab8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
23 QuartzCore 0x00000001080b0bf8 -[CALayer layoutSublayers] + 146
24 QuartzCore 0x00000001080a4440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
25 QuartzCore 0x00000001080a42be _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
26 QuartzCore 0x0000000108032318 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
27 QuartzCore 0x000000010805f3ff _ZN2CA11Transaction6commitEv + 475
28 QuartzCore 0x000000010805f87d _ZN2CA11Transaction14release_threadEPv + 593
29 libsystem_pthread.dylib 0x0000000108dd550f _pthread_tsd_cleanup + 544
30 libsystem_pthread.dylib 0x0000000108dd5249 _pthread_exit + 152
31 libsystem_pthread.dylib 0x0000000108dd37cd pthread_attr_getschedpolicy + 0
32 libsystem_pthread.dylib 0x0000000108dd31ed start_wqthread + 13
)

When on simulator
Open the example
open the album selector
CMD-SHIFT-H
Open Photo app
Add favorites, new album
CMD-SHIFT-H x2 and reopen the example

Tried

- (void)loadData
{
    //[self.tableView reloadData];
    [self.tableView beginUpdates];
    [self.tableView reloadData];
    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:(UITableViewRowAnimationAutomatic)];
    [self.tableView endUpdates];
    //[self.tableView reloadData];
}

Ok thanks for the error report I will have a look on this.