Amazon.com Widgets Strange memory problem ...
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 01, 2014, 04:25:04 PM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Old Stuff
| |-+ Chapter Study
| | |-+ Chapter 21 - Writing iPhone Applications
| | | |-+ Strange memory problem ...
Pages: [1] Go Down
Print
Author Topic: Strange memory problem ... (Read 654 times)
rrivas
Newbie
*
Posts: 9


Email




on: March 27, 2012, 08:55:27 PM

Hi,
   OK. At the end of my rope ... Breezed through the entire book (3rd ed) up-to program 21.2 where I had to get new Mac OS X (Lion) and Xcode 4.3.1. I was able to get program 21.1 to run but the Fraction Calculator has a strange memory problem.

The code compiles fine. My UI is fine. But it appears that the memory for my variables is locked.

If I look at self.displayString after its initialized (as shown below) its memory is still nil (0x0).

- (void)viewDidLoad
{
    [super viewDidLoad];
   // Do any additional setup after loading the view, typically from a nib.
   
    firstOperand = YES;
    isNumerator = YES;
    currentNumber = 0;
    self.displayString = [NSMutableString stringWithCapacity: 40];
    myCalculator = [[Calculator alloc] init];
}

My ARC setting is unchecked when I created my project. I'm sure this is a rookie mistake but someone please give me some guidance!

Thanks, in advance.

Ramon.

PS: This has also been posted in the Help! section.
Logged
rrivas
Newbie
*
Posts: 9


Email




Reply #1 on: March 28, 2012, 05:11:14 AM

OK. Did some further checking and just thought to put some NSLog() statements ... to my surprise the printed the correct values! My previous statement was based on the values I was seeing in the debugger. So, somehow my variables in the debugger (all of them) are not displaying the correct values!

Appreciate any insight into this...

Ramon.

PS: Back to old fashion debugging for now!
Logged
rrivas
Newbie
*
Posts: 9


Email




Reply #2 on: April 01, 2012, 11:35:59 AM

Hi,
     The debugger problem is solved in Xcode v4.3.2 which was recently made available by Apple.

Ramon.
Logged
Pages: [1] Go Up
Print
Jump to:



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.