swizzling

willMoveToWindow is called twice

柔情痞子 提交于 2021-01-27 06:28:27
问题 I'm swizzling willMoveToWindow: and I came across an issue where it was being called twice on views. When a new view controller is pushed onto a UINavigationController , willMoveToWindow: is called on the existing view with nil value (Makes sense since the view is moving offscreen) After that time, the method willMoveToWindow: is called again , but now with with the original window. My initial thought is that swizzling and calling the window property before the original method has kicked in.

willMoveToWindow is called twice

怎甘沉沦 提交于 2021-01-27 06:27:10
问题 I'm swizzling willMoveToWindow: and I came across an issue where it was being called twice on views. When a new view controller is pushed onto a UINavigationController , willMoveToWindow: is called on the existing view with nil value (Makes sense since the view is moving offscreen) After that time, the method willMoveToWindow: is called again , but now with with the original window. My initial thought is that swizzling and calling the window property before the original method has kicked in.

Can I swizzle didSelectRowAtIndexPath: of UITableViewDelegate?

天涯浪子 提交于 2021-01-20 20:25:33
问题 The problem is this: I need to be able to get analytics on didSelectRowAtIndexPath throughout a big existing app with lots of tableViews. My first thought of this is doing method swizzling on didSelectRowAtIndexPath: but my app crashes with "unrecognized selector sent to instance" message depending on the stuff is accessed in the original didSelectRowAtIndexPath implementation. Here is how I try to achieve this in a UIViewController category: #import "UIViewController+Swizzle.h"

Can I swizzle didSelectRowAtIndexPath: of UITableViewDelegate?

怎甘沉沦 提交于 2021-01-20 20:25:30
问题 The problem is this: I need to be able to get analytics on didSelectRowAtIndexPath throughout a big existing app with lots of tableViews. My first thought of this is doing method swizzling on didSelectRowAtIndexPath: but my app crashes with "unrecognized selector sent to instance" message depending on the stuff is accessed in the original didSelectRowAtIndexPath implementation. Here is how I try to achieve this in a UIViewController category: #import "UIViewController+Swizzle.h"

Firebase Cloud Messaging Notifications for iOS not showing opened and analytics

蹲街弑〆低调 提交于 2020-07-20 10:53:08
问题 I'am using FCM to send notifications to iOS apps. The notifications are received on the device well, but I can not get the "Opened" or "Conversion " rate in the Notification console GUI. It always shows "0 opened" and "0 Conversion" for almost 200 0000 notifications sent. I double checked all the implementation but I can't get it working. I have FirebaseAppDelegateProxyEnabled set to YES in plist. I implemented all the methods listed on Firebase guides and docs. I don't have any notification

Copy a method IMP for multiple method swizzles

时光总嘲笑我的痴心妄想 提交于 2020-01-02 05:18:11
问题 I have a class set up that ideally will read the methods of any class passed in and then map all of them to on single selector at runtime before forwarding them off to their original selector. This does work right now, but I can only do it for one method at a time. The issue seems to be that once I swizzle the first method, my IMP to catch and forward the method has now been swapped with that other methods IMP. Any further attempts at this screw up because they use newly swapped IMP to

Advice on how to catch “attempt to insert nil object” from a device needed

对着背影说爱祢 提交于 2020-01-01 15:11:34
问题 Here is a situation: Hockeyapp and testflight every now and then complain about me "attempting to insert nil object" in mutable dictionaries/arrays. I know the right thing is to check for nil all the time, and I do when it makes sense.. Our testers can not catch those crashes, but AppStore users obviously can. My guess is that sometimes server returns NSNulls when it should not. So not to insert checks for nil everywhere in the huge project my idea was to create a separate target for the

Advice on how to catch “attempt to insert nil object” from a device needed

扶醉桌前 提交于 2020-01-01 15:11:10
问题 Here is a situation: Hockeyapp and testflight every now and then complain about me "attempting to insert nil object" in mutable dictionaries/arrays. I know the right thing is to check for nil all the time, and I do when it makes sense.. Our testers can not catch those crashes, but AppStore users obviously can. My guess is that sometimes server returns NSNulls when it should not. So not to insert checks for nil everywhere in the huge project my idea was to create a separate target for the

Advice on how to catch “attempt to insert nil object” from a device needed

拜拜、爱过 提交于 2020-01-01 15:11:06
问题 Here is a situation: Hockeyapp and testflight every now and then complain about me "attempting to insert nil object" in mutable dictionaries/arrays. I know the right thing is to check for nil all the time, and I do when it makes sense.. Our testers can not catch those crashes, but AppStore users obviously can. My guess is that sometimes server returns NSNulls when it should not. So not to insert checks for nil everywhere in the huge project my idea was to create a separate target for the