strong-references Questions

3

I'm trying to figure out how NSMapTable works So I'm trying in playground the following code: class Person { var name: String init(name: String ) { self.name = name print("\(name) is being i...
Capeskin asked 27/10, 2017 at 19:34

1

Solved

I'm building a physics engine in Swift. After making some recent additions to the engine and running the benchmarking tests I noticed the performance was drastically slower. For example, in the scr...
Marylinmarylinda asked 31/10, 2019 at 0:13

4

Solved

When I execute this code: [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(showButtons) userInfo:nil repeats:NO]; do I need to nil it or release it, ot whatever for mem...
Waki asked 23/11, 2012 at 19:10

1

Solved

As a follow up to my previous How can I create a reference cycle using dispatchQueues?: For the strong references (that create leaks, but aren't reference cycles) e.g. Timer, DispatchSourceTimer,...

1

Is it true that ARC keeps a count of unowned references to an object? So, if the strong reference count of an object reaches 0 and the unowned reference count of that object is > 0 the object is d...

3

Can anyone explain me self.timer=nil vs [self.timer invalidate]? What exactly happens at the memory location of self.timer? In my code self.timer=nil doesn't stops the timer but [self.timer ...

5

Is there a tool or method to locate strong references cycles in my SWIFT code? A strong reference cycle is when two instances of classes reference each other without the proper safeties (weak/uno...
Sebaceous asked 28/8, 2015 at 1:55

3

Solved

Can anyone please explain why this doesn't leak? I'm capturing self within a closure so I would have two strong pointers pointing at each other, therefore, the deinit message shouldn't ever be ca...
Pyretotherapy asked 10/8, 2016 at 14:39

4

Solved

I am a little bit stubborn, but I want to understand weak and strong references well, so that's why I'm asking you once again. Consider this: __weak NSString* mySecondPointer = myText; NSLog(@"m...

3

Solved

in my projects I don't use Interface Builder and I've noticed one thing that I don't know how to explain. Yet. So, to the point. When we are using IB and defining elements of user interface like UI...
Drover asked 7/2, 2013 at 21:47

2

Possible Duplicate: Why do weak NSString properties not get released in iOS? I'm a newbie to Objective C and I've got some questions that I cannot answer myself. I have a block of co...
Cysteine asked 2/1, 2013 at 4:56

2

Solved

I have switched my project to ARC, and I don't understand if I have to use strong or weak for IBOutlets. Xcode do this: in interface builder, if a create a UILabel for example and I connect i...

3

Solved

Suppose I have a WeakReference of a target strong reference. I'd like to be informed when the target object itself is being collected by the GC. Is it possible? EDIT: Adding code to the finalizer/...
Paperweight asked 28/12, 2011 at 10:38

2

Solved

Wikipedia states "In computer programming, a weak reference is a reference that does not protect the referenced object from collection by a garbage collector". How do those two types of references ...
Subjunction asked 5/9, 2011 at 10:14
1

© 2022 - 2024 — McMap. All rights reserved.