All Questions
Tagged with objective-c memory-management
3,084
questions
-1
votes
0
answers
38
views
Is there a way to force an NSObject to be allocated in stack or static memory?
I am asking this out of curiosity, because even if this can technically be done, this is almost certainly unsupported by Apple.
As far as I can tell, only NSString literals, and possibly NSDictionary ...
0
votes
0
answers
48
views
Releasing object when you get it from another function
For some unavoidable reasons I have to work on a program with Objective-C and manual memory management environment (no ARC).
I am filtering an array that I receive from another function like following:...
0
votes
1
answer
62
views
Store or copy AXUIElementRef from callback
I'm trying to store an AXUIElementRef provided by an AXObserverCallback callback. When the callback scope ends, I believe the struct gets freed and I'm no longer able to use it elsewhere.
Is there a ...
0
votes
0
answers
199
views
my flutter engine.profiler (52): EXC_BAD_ACCESS (code=EXC_I386_GPFLT) in swift
I need to call the flutter engine all time
.So I given the code as below.
In the appdelegate.h file
@property (nonatomic,strong) FlutterEngine *flutterEngine;
In the appdelegate.m file
- (BOOL)...
0
votes
0
answers
256
views
Crash due to Heap corruption when calling swift static function from Objective C++ (.mm)
I am working on cross-platform graphics library which for iOS uses Metal API.
Core of the library is in C++, then I'm implementing some derived classes in Objective C++ (.mm) code.
From my derived ...
0
votes
2
answers
43
views
Do I have to specify memory management properties with ARC?
Since, ARC is now a standard for many years do I have to write code like this:
@property (nonatomic, retain) NSString *title;
@property (copy) NSString *subtitle;
Or just simplify it to this?
@...
1
vote
1
answer
222
views
ios invoke block target with copy method,but crashed
I use invocation call block copy, I think it's equals to [block copy],but crashed why?
@implementation MyService
+ (void)load {
[MyService startRequest:^(id _Nonnull responseObject, ...
1
vote
3
answers
305
views
Can we check if an Objc object was deallocated before "bridging" it from void* to UIKit object?
I'm using QTouchposeApplication library (particularly a class TRTouchposeApplication from develop branch).
There were crashes in one of the execution paths in master branch, and the author fixed them ...
2
votes
1
answer
2k
views
How to call size_t os_proc_available_memory(void) with swift
I've never had to call a Obj C function from Swift and most of the info I see out there is for importing frameworks and such so I'm having trouble understanding how to get the data I need.
I want to ...
0
votes
1
answer
31
views
Do NSArray and NSMutableArray classes take up the same size in memory?
I'll have to work with millions of representations stored as indexes in multiple NSArray objects or NSMutableArray objects. Which one of these classes takes up the least memory?
0
votes
1
answer
343
views
Proper way to CFRelease CFMutableArrayRef contents
I am using CFMutableArrayRef in my code. There I am adding several CFTypeRef elements.
When I am done using the array, do I need to call CFArrayRemoveAllValues(myArray); before actually releasing the ...
0
votes
1
answer
125
views
ARC and pointer storing
My situation is a bit more complex than what I've seen here before posting, and I'm not really good with memory management.
I have a custom UITableViewCell (that we will call MyCell here) and I pass ...
0
votes
2
answers
279
views
Manually how to deallocate an object (NSString / NSMutableString ,..) under ARC in Objective C
Initialised an Object (NSString / NSMutableArray) and set value for that. I need to deallocate the object, then have to assign a value to that object to get an error of that's already been ...
0
votes
1
answer
65
views
How to prevent notitifcation observer from being called after UIViewController is popped?
I have 2 UIViewController A and B. From A I pushed B and B has 2 observers for reachability. Now when I pop B and comes to A after this if Network goes off then the method written in VC B is called. I'...
1
vote
2
answers
47
views
weakSelf not _always_ needed in iOS and ObjC, right? [duplicate]
Help me resolve a tiny argument with a colleague. Weak self is not needed in this circumstance, right?
(He doesn't believe me)
__weak auto weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
...