ios - [__NSCFString objectForKey :]: unrecognized selector sent to instance
<p><div>
<aside class="s-notice s-notice__info post-notice js-post-notice mb16"role="status">
<div class="d-flex fd-column fw-nowrap">
<div class="d-flex fw-nowrap">
<div class="flex--item wmn0 fl1 lh-lg">
<div class="flex--item fl1 lh-lg">
<b>已结束。</b>此问题需要<a href="https://stackoverflow.com/help/minimal-reproducible-example" rel="noreferrer noopener nofollow">debugging details</a> .它目前不接受答案。
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>如果 <code>object</code> 有时是 NSDictionary 有时是 NSString 你可以检查它并以不同的方式处理它:</p>
<pre><code>+(CGFloat)heightForViewWithObject:(id)object inColumnWidth:(CGFloat)columnWidth {
NSString *titleText = ] ? : object;
}
</code></pre>
<blockquote>
<p>(BOOL)isKindOfClass:(Class)aClass</p>
<p>Returns a Boolean value that indicates whether the receiver is an instance of given
class or an instance of any class that inherits from that class.</p>
</blockquote></p>
<p style="font-size: 20px;">关于ios - : unrecognized selector sent to instance,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/24651136/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/24651136/
</a>
</p>
页:
[1]