respondstoselector

super respondsToSelector: returns true but actually calling super (selector) gives “unrecognized selector sent to instance”

旧时模样 提交于 2020-02-13 04:09:51
问题 OK, I am a little confused. I have a subclass of UIScrollView, which is my attempt at a horizontally scrolling "table view" like UI element. UIScrollView itself sets up UIGestureRecognizers it uses internally, and it appears to set itself up as the delegate for those UIGestureRecognizers. I also have my own UIGestureRecognizer setup on my horizontal table elements/cells and my own class set as delegate for my own UIGestureRecognizer. Since my class is a subclass of UIScrollView, at runtime,

super respondsToSelector: returns true but actually calling super (selector) gives “unrecognized selector sent to instance”

巧了我就是萌 提交于 2020-02-13 04:09:13
问题 OK, I am a little confused. I have a subclass of UIScrollView, which is my attempt at a horizontally scrolling "table view" like UI element. UIScrollView itself sets up UIGestureRecognizers it uses internally, and it appears to set itself up as the delegate for those UIGestureRecognizers. I also have my own UIGestureRecognizer setup on my horizontal table elements/cells and my own class set as delegate for my own UIGestureRecognizer. Since my class is a subclass of UIScrollView, at runtime,

Are performSelector and respondsToSelector banned by App Store?

主宰稳场 提交于 2019-12-28 04:31:11
问题 My latest build was accepted into the Apple app store, but I got the notice quoted below a couple of days later. My app also uses Rollout.io, and I asked explicitly if this was the problem. No response yet. If respondsToSelector or performSelector are banned, are there any replacements? Dear Developer, Your app, extension, and/or linked framework appears to contain code designed explicitly with the capability to change your app’s behavior or functionality after App Review approval, which is

Objective-C: Why check nil before respondsToSelector:?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 06:47:37
问题 I've seen code like: if (delegate != nil && [delegate respondsToSelector:@selector(doSomething)]) ... But, sending a message to nil just returns nil (which evaluates to NO ), so why not just do: if ([delegate respondsToSelector:@selector(doSomething)]) ... Is the former faster if delegate == nil ? Either way, I prefer the latter cause it's less code. And, less is better than more . Every Unix pro knows that. 回答1: objc_msgSend, the function used to send dynamic messages in Objective-C

Objective C - respondsToSelector for dynamic properties

て烟熏妆下的殇ゞ 提交于 2019-12-14 03:43:42
问题 I am currently facing the problem to check whether a property of an Object (NSManagedObject) exists or not. Unfortunately the method [[MyObject class] respondsToSelector:@selector(myProperty)]; always returns NO. I think it's because the property generated by CoreData is a new style property ala @property (nonatomic, strong) NSString *myProperty So any ideas how to solve this issue? I would really appreciate all of your suggestions ;) Thanks in advance! Alex 回答1: [[MyObject class]

Are performSelector and respondsToSelector banned by App Store?

一曲冷凌霜 提交于 2019-12-11 07:27:55
问题 My latest build was accepted into the Apple app store, but I got the notice quoted below a couple of days later. My app also uses Rollout.io, and I asked explicitly if this was the problem. No response yet. If respondsToSelector or performSelector are banned, are there any replacements? Dear Developer, Your app, extension, and/or linked framework appears to contain code designed explicitly with the capability to change your app’s behavior or functionality after App Review approval, which is

respondsToSelector - not working

依然范特西╮ 提交于 2019-12-11 01:42:18
问题 I've read through like 10 posts, but haven't found what's wrong with my implementation. This app was written in iOS 6 but updated to iOS7, so I want to offer support for both iOS6 and iOS7. But if I run an iOS7-only method on an iOS6 device, it breaks. So I thought of adding respondsToSelector, to check it has iOS7 on it, but for some reason, the if always returns false. AppDelegate.m: if ([[UINavigationBar appearance] respondsToSelector:@selector(shadowImage)]) if ([[UINavigationBar

Objective C - respondsToSelector for dynamic properties

这一生的挚爱 提交于 2019-12-05 18:46:00
I am currently facing the problem to check whether a property of an Object (NSManagedObject) exists or not. Unfortunately the method [[MyObject class] respondsToSelector:@selector(myProperty)]; always returns NO. I think it's because the property generated by CoreData is a new style property ala @property (nonatomic, strong) NSString *myProperty So any ideas how to solve this issue? I would really appreciate all of your suggestions ;) Thanks in advance! Alex [[MyObject class] respondsToSelector:...] asks whether the metaobject responds to that selector. So, in effect, it asks whether there is

super respondsToSelector: returns true but actually calling super (selector) gives “unrecognized selector sent to instance”

不问归期 提交于 2019-11-30 11:06:09
OK, I am a little confused. I have a subclass of UIScrollView, which is my attempt at a horizontally scrolling "table view" like UI element. UIScrollView itself sets up UIGestureRecognizers it uses internally, and it appears to set itself up as the delegate for those UIGestureRecognizers. I also have my own UIGestureRecognizer setup on my horizontal table elements/cells and my own class set as delegate for my own UIGestureRecognizer. Since my class is a subclass of UIScrollView, at runtime, the UIGestureRecognizer delegate calls come to my class for both the UIScrollView in-built

Are performSelector and respondsToSelector banned by App Store?

删除回忆录丶 提交于 2019-11-27 16:09:14
My latest build was accepted into the Apple app store, but I got the notice quoted below a couple of days later. My app also uses Rollout.io, and I asked explicitly if this was the problem. No response yet. If respondsToSelector or performSelector are banned, are there any replacements? Dear Developer, Your app, extension, and/or linked framework appears to contain code designed explicitly with the capability to change your app’s behavior or functionality after App Review approval, which is not in compliance with section 3.3.2 of the Apple Developer Program License Agreement and App Store