Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
December 16, 2017, 09:26:27 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: Example 7.1 not giving any output in Xcode 4  (Read 1607 times)
pejobass
Newbie
*
Posts: 2


« on: July 01, 2011, 09:14:02 AM »

When I run example 7.1 in xcode 4

I get no output, a new gray window appears, it stays empty and I get no out put but not errors either.
Any suggestion?

Thank you.

Andrea
 Huh

Logged
skochan
Administrator
Hero Member
*****
Posts: 3114



« Reply #1 on: July 01, 2011, 10:21:07 AM »

Are you getting output from your other program examples?   Make sure in XCode 4 that the Console view appears (and not just the Variables view).  I've been burned by that before.

Cheers,

Steve
Logged
pejobass
Newbie
*
Posts: 2


« Reply #2 on: July 01, 2011, 11:33:23 AM »

Hi,

Thank you so much for your quick response, I really appreciate.
I found what the problem was.

Xcode 4 automatically had this line inserted (in red):


int main(int argc, char *argv[])
{
    return NSApplicationMain(argc, (const char **)argv);
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    Fraction *myFraction = [[Fraction alloc] init];
   
    [myFraction setNumerator: 1];
    [myFraction setDenominator: 3];


I am not sure what it does but after I put the comments marks and disabled it works.

It is a bit confusing reading the book that was based I assume on Xcode 3 and using Xcode 4 since things do not match exactly.

Andrea
Logged
skochan
Administrator
Hero Member
*****
Posts: 3114



« Reply #3 on: July 01, 2011, 02:02:02 PM »

Andrea,

You didn't start with a Command Line Tool, which is why that line was in there.  Also, the 3rd edition covers XCode 4.  I try my best to keep up with Apple's changes.

Cheers,

Steve
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

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 ゥ 2009 classroomM.com. All rights reserved.