iphone - Checking singleton property with nil value causes error -


When I check a single property which is not zero, then it hits my app but when I do a class Examples look for zero on the property, everything works fine

This works fine:.

  self.MyProperty == zero  

but the application will end with "EXC_BAD_ACCESS"

  [MySingleton SharedManager] .SomeProperty! = Void  

What is the difference between? Singleton that I can not check for zero

Here is the singleton implementation:

File h:

@interface MySingleton: NSObject {NSString * SomeProperty; } @protecti (nontomic, copy) nssting * some pratiti; + (Massiglittan *) shared manager; @end

.m file:

  #import "MySitington" Fixed MySettington * SharedMenger = Zero; @Milangington @ Sintex Some Properties; - (zero) Delok [[Some Proprietary Dellok]; [Super DeLoc]; } + (Messiglton *) shared manager {if (! Shared manager) {sharedManager = [[missing alloc] init]; } Return Share Manager; }  

This is what I think in the console when trying to assign something to SomeProperty:

 MyApp (51363,0xa0389500) malloc: *** mmap (Size = 2147487744) Failed (Error code = 12) *** Error: Can not allocate area *** Set breakpoint in malloc_error_break to debug currently: auto; Currently Objective-C (GDB) brake malloc_error_break Note: Breakpoints 6 and 8 also to continue 0x929c2072 on 0x929c2072 (gdb) on Breakpoint 11 (gdb) Po [MySingleton sharedManager]. SomeProperty address 0x0 did not use memory Can go to (gdb) [MySingleton sharedManager] & LT; Session: 0x1938fa0 & gt; 

When I try to allocate when trying to assign the variable where the accident occurs

.

  - (zero) Delok {[some of Delok]; [Super DeLoc]; }  

And some other code, I want to go to one organ and say that there are other problems with this code, the combination of which is moving towards the problem, you have indicated that in particular , You should ever call -dealloc directly (besides [super dealloc] ). If you have other parts of your code and it is being executed, then it can easily cause the symptoms you described.

If you want a more specific answer, then post the crossover backtrace.

  MyApp (51363,0xa0389500) malloc: * mmap (size = 2147487744) failed (error code = 12) error: area can not allocate ** default to debug in malloc_error_break one Set Breakpoints: Auto; At present, set the breakpoint according to the objective c- 

and then run the application again . Once this error message is over, all bets are closed because your app has already been closed. You need the call when the calls are made.

What's happening is that some MMAP () is calling to map to 2GB address space. Corruption can be bad code.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -