Questions tagged [isa-swizzling]

8 questions
10
votes
1 answer

Are method swizzling and isa swizzling the same thing?

Are method swizzling and isa swizzling the same thing? If not, then what is isa swizzling?
Mayank
  • 643
  • 8
  • 19
9
votes
1 answer

Swift - method swizzling

This is the method swizzling code written in Objective-C. I am having a hard time converting this in Swift. void MPApplicationDidRegisterForRemoteNotificationsWithDeviceToken(id self, SEL _cmd, UIApplication *application, NSData *deviceToken) { …
Nitish
  • 13,845
  • 28
  • 135
  • 263
5
votes
1 answer

My isa-swizzling breaks KVO

I'm trying to implement isa swizzling because I need some actions to happen in dealloc method of certain object. I'm overriding - (Class)class; method to return original class (as KVO does). Everything works fine, until I try to add observer to…
1
vote
2 answers

recursive swizzling causes crash

I'm using DAKeyboardControll on my app . it has a method with name : swizzled_addSubview and implement Like this: - (void)swizzled_addSubview:(UIView *)subview { if (!subview.inputAccessoryView) { if ([subview isKindOfClass:[UITextField…
Mo Farhand
  • 1,144
  • 8
  • 21
1
vote
1 answer

ISA swizzling and calls to `super`

Assume the following class hierarchy. Class A is publicly declared: @interface A : NSObject + (A)createInstance; - (void)a; @end Class _B is a private subclass of A: @interface _B : A - (void)a; - (void)b; @end Assume objects of class A should…
Léo Natan
  • 56,823
  • 9
  • 150
  • 195
1
vote
2 answers

I'm having trouble adding two matrices in python

I want to add two matrcies in python 3 but the problem comes when I add input to the program Here is my code def addmatrix(a,b): d=[] n=0 while n < len (a): c = [] k = 0 while k < len (a[0]) : …
Jett
  • 2,421
  • 5
  • 16
  • 14
0
votes
2 answers

Object was created as a superclass, want to turn that into a subclass

I was given a library with generic data objects in it, Projects, Tables, Rows and Fields. In my program I have a single Project called Building, its Table 1 contains "Units", and Field 1 of Table 1 is "Unitname". So what I did was... Public Class…
Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98
0
votes
1 answer

Objective-c: Swizzling class results in loss of properties from debug

I create a runtime class and then swizzle an instance to be an instance of that new class. MyClass *object = [MyClass new]; Class subclass = objc_allocateClassPair([MyClass class], "MyClass_RuntimeClass",…
MarcB
  • 1
  • 1