我想使用ARC項目中使用TPMultiLayoutViewController,但我碰到下面的錯誤: -TPMultiLayoutViewController的ARC轉換; Objective-C的指針,以「常量無效*」的隱式轉換是不允許與ARC
Implicit conversion of an Objective-C pointer to 'const void *' is disallowed with ARC
我我真的不知道如何解決這個問題。它需要明確轉換嗎?我該怎麼做?
- (void)addAttributesForSubviewHierarchy:(UIView*)view associatedWithSubviewHierarchy:(UIView*)associatedView toTable:(NSMutableDictionary*)table {
[table setObject:[self attributesForView:view] forKey:[NSValue valueWithPointer:associatedView]];
if (![self shouldDescendIntoSubviewsOfView:view]) return;
for (UIView *subview in view.subviews) {
UIView *associatedSubView = (view == associatedView ? subview : [self findAssociatedViewForView:subview amongViews:associatedView.subviews]);
if (associatedSubView) {
[self addAttributesForSubviewHierarchy:subview associatedWithSubviewHierarchy:associatedSubView toTable:table];
}
}
}
哪條線有錯誤? – Mark
第一個在方法 '[table setObject:[self attributesForView:view] forKey:[NSValue valueWithPointer:associatedView]];' – akbsteam
它的這部分特別是'[NSValue valueWithPointer:associatedView]' – akbsteam