Welcome, Guest. Please login or register.
Did you miss your activation email?
September 07, 2010, 11:29:51 PM
Home Help Search chat Login Register   
News:   If you like the book and forum please  write a review on Amazon   Recorded lessons available for iPad viewing and download....in process! Consulting and onsite training available!   If you're running Xcode 3.2 (or later), see this post   Follow me on Twitter  @skochan  Forum Guests: register to download (or see) attachments.    Join our mailing list.


+  Official Forum for Programming in Objective-C 2.0 (the iPhone Programming Language) - Stephen Kochan
|-+  Programming in Objective-C 2.0, 2nd ed. (Stephen Kochan)
| |-+  Help!!!
| | |-+  Xcode 3.2 and Programming in Objective-C (book)
« previous next »
Pages: [1] 2 Go Down Print
Author Topic: Xcode 3.2 and Programming in Objective-C (book)  (Read 8888 times)
tangoravi
Newbie
*
Posts: 29


Email
« on: September 01, 2009, 08:39:47 PM »

What template do I use to do the assignments? In Xcode 3.2, the New Project dialog does not have Command Line Utility as a choice in the templates. Sad
Logged
tdg911
Newbie
*
Posts: 7


Email
« Reply #1 on: September 01, 2009, 08:50:16 PM »

 click new project.  on the left click applications, right click command line tool, drop down list to select foundation.  I've included a screen shot of what it looks like.

Hope this helps.

T
Logged
skochan
Administrator
Hero Member
*****
Posts: 2250



« Reply #2 on: September 01, 2009, 10:34:46 PM »

Thanks for posting that.  I wasn't aware of the changes.   Just finished installing Snow Leopard tonight.

Cheers,

Steve Kochan
Logged
c is 4 cookie
Newbie
*
Posts: 4


« Reply #3 on: September 07, 2009, 06:47:16 AM »

omg you saved my azz.

Steve, feel free to delete my new post asking about this in the Welcome forum lol However if it wasn't for Google I wouldn't have found this other thread ironically enough.

EDIT: A
Code: (Objective-C)
Proj1.m:6: error: expected expression before '@' token
message won't go away.





Thanks
« Last Edit: September 07, 2009, 10:00:54 AM by c is 4 cookie » Logged
slessardjr
Newbie
*
Posts: 17

tranquility1011
Email
« Reply #4 on: September 08, 2009, 07:58:13 PM »

sounds to me something isn't installed right or something's set wrong.  If  you could zip you project folder and add it to your post I'd be glad to see what went wrong.  I could even test it on my machine if you'd like. 

Sorry I couldn't be more immediate help, but it's sometimes hard to diagnose a problem from a picture
Logged

~Steve
slessardjr
Newbie
*
Posts: 17

tranquility1011
Email
« Reply #5 on: September 08, 2009, 08:01:12 PM »

Looking at it again... add this piece of code before int main....
Code: (Objective-C)
#import <Foundation/Foundation.h>

That may be your problem.  The foundation framework needs to be imported so the program knows what NSLog is.  Thats why it says expression before '@', because the compiler does not know what NSLog is without the foundation framework.
Logged

~Steve
Stephen F.
Newbie
*
Posts: 6


« Reply #6 on: September 08, 2009, 08:23:24 PM »

This is just a guess, but it might be an issue with the double-quotes used in that NSLog line. If you look closely, there are are slanted double-quote characters, whereas in my Xcode, the double-quotes are straight.

 - My Xcode has this: "
 - Pictured Xcode has this:

Slanted or curly quotes would not be recognised by the compiler, and it could just be that that code snippet was copied and pasted from the PDF of the slides, rather than typed into Xcode directly. Keynote, Powerpoint, Word and other such tools have automatic "smart" character replacement options to switch straight quotes with fancy quotes.

On the other hand, maybe the Japanese Unicode font being used there just has stylised slanted quotes rather than straight ones. Are you using a US English keyboard layout, or a Kotoeri or other Asian layout? If you're typing on a non US English keyboard layout, Mac OS X may be helpfully substituting characters you type for Unicode characters. Those "\342" sequences in the error message look like escape sequences, perhaps for Unicode characters.

Maybe try typing the program in again from scratch, and if that doesn't work, switch to the US English interface localisation and keyboard layout in Mac OS X, restart Xcode, create a new project, and try again.
« Last Edit: September 08, 2009, 08:43:48 PM by Stephen F. » Logged
c is 4 cookie
Newbie
*
Posts: 4


« Reply #7 on: September 11, 2009, 04:14:05 AM »

 Tongue

To all noobs like me, do NOT copy and paste from PDF's OR make sure you fix the slanted quotes.

Thanks Steve for the heads up and thanks for others who tried to help.

Between the new Xcode labeling things differently and not knowing about different quotation marks, step 1 has already made me feel like a tool  Cheesy I guarantee I won't be the only one trying to figure out wtf went wrong on day one.

Also after building and running nothing happened. It did complete successfully though. I guess I was expecting to receive encrypted NSA codes from the heavens above.

Sure hope that DVD comes out soon.
« Last Edit: September 11, 2009, 04:20:18 AM by c is 4 cookie » Logged
Grossmisconduct
Newbie
*
Posts: 5


« Reply #8 on: September 24, 2009, 11:03:14 AM »

Hi! I am a total noobi and iv also had a problem programming with Xcode 3.2. When i build and run Program 3.2 the debugger returns a long list of greek. Iv added my file as I saw you requested in another post. i hope you could find time to read it and see if you have an explanation
Logged
rgronlie
Global Moderator
Full Member
*****
Posts: 221



« Reply #9 on: September 24, 2009, 11:28:04 AM »

If you read the 'Greek' carefully it explains what the problem is.

Quote
2009-09-24 11:22:47.549 DA3[3512:a0f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[Fraction<0x1000010d0> init]: cannot init a class object.'

You are calling myFraction = [Fraction init]; but init is an instance method not a class method so you need to pass the init message to myFraction instead.

Code: (Objective-C)
myFraction = [myFraction init];

Ryan
Logged

Sanity: Minds are like parachutes. Just because you've lost yours doesn't mean you can borrow mine.
Grossmisconduct
Newbie
*
Posts: 5


« Reply #10 on: September 24, 2009, 12:02:59 PM »

Thank you, Ryan! And for the fast reply too! I cant believe I missed that one, ive checked my text for miss-spellings 15 times. And sorry for posting this under the wrong subject, but it was to me the most probable cause after thinking id done a thorough miss-spelling check. Now I im looking forward to continuing reading my book
Logged
waynesel
Newbie
*
Posts: 2


Email
« Reply #11 on: March 28, 2010, 11:05:42 AM »

Has anyone posted a list of changes between Xcode 3.2 and the Video and or the Book?

Really new guy
Logged
skochan
Administrator
Hero Member
*****
Posts: 2250



« Reply #12 on: March 28, 2010, 11:47:17 AM »

There isn't a list but there aren't many references to XCode or to screen shots in the text.  The figure at the top of this post covers the most significant change in getting started.   The only place you might get stuck again is in Chapter 21; there are some slight differences in the screens when creating a new iPhone application.  Those have been updated in the video webcasts (not the LiveLessons ones, the webcast-recorded ones).

Cheers,

Steve Kochan
Logged
waynesel
Newbie
*
Posts: 2


Email
« Reply #13 on: March 28, 2010, 12:27:59 PM »

Thank You Very Much.  I was a 4th Dimension programmer way back when Guy Kawasaki was there and have just decided to get back into the Frey with the iPhone/iPad, looks like fun.  No other language experience.

Thanks Again
Logged
hnickm
Newbie
*
Posts: 1


Email
« Reply #14 on: March 29, 2010, 09:11:26 AM »

OK, thanks for the above.
Here's another noob question:
pg 134, fig 7.1 Under "Cocoa">"Objective-C class".
The new Xcode (3.2.1) doesn't look anything like the figure.
I can't figure out how to add the new class.

Thanks for any help.
Nick
Logged
Pages: [1] 2 Go Up Print 
« previous next »
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.