 |
 |
O'reilly's learn Cocoa
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
Just ordered a copy... wanted to have it for a long time.
I was wondering :
What do you think of this book ?
Is it a good way to start working/programming in OSX ?
Thanks ! 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Louisiana
Status:
Offline
|
|
Originally posted by iNeusch:
<STRONG>Just ordered a copy... wanted to have it for a long time.
I was wondering :
What do you think of this book ?
Is it a good way to start working/programming in OSX ?
Thanks !  </STRONG>
I bought Cocoa Programming for Mac OS X because I heard it was better.
|
|
B&W G3/300 OS X 10.3 Server
AL G4/1.5 OS X 10.3
Next computer G5/3.X Ghz OS X 10.x.x
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2002
Location: Cambridge, England
Status:
Offline
|
|
Originally posted by iNeusch:
<STRONG>Just ordered a copy... wanted to have it for a long time.
I was wondering :
What do you think of this book ?
Is it a good way to start working/programming in OSX ?
Thanks !  </STRONG>
I have this book. It is okay for starting out with Cocoa, but it can't really be used as a reference book. Objective-C has a really steep learning curve (object deallocation etc) and this book takes you in gently and leads up to some quite complicated projects.
In my opinion it would be better if they told you how to use cocoa with Java and not just objective-C.
|
|
mmmm - I'm a big Cinnamon bun.
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
Get the Aaron Hilegass "cocoa programming for mac os x" book - it's much better - everything is explained more clearly. I have both.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
Get them both. Use Hillegass's book first, to actually learn Cocoa, and then use the O'Reilly book to polish your skills. O'Reilly's book is not for beginners, despite the title, but it's a great one for polishing up skills you've recently acquired.
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jul 2001
Status:
Offline
|
|
Originally posted by iNeusch:
<STRONG>
What do you think of this book ?
Is it a good way to start working/programming in OSX ?</STRONG>
I like Cocoa Programming for Mac OS X better. I picked up the O'Reilly book this summer and worked through it in tandem with my father's copy of NeXTSTEP Programming Step One: Object-Oriented Applications. The Hillegass book is much better, IMHO.
I suppose the usefulness of either book has partly to do with your previous programming experience.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
OK... looked for the other book you are all talking about... but it's not available in France for now...
Thanks for all your answer, it's a pleasure to be part of the mac community
I'll try to work with that one, and eventually I'll ask questions on this forum as I learn 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
Just went to another shop near my house... both books were there !
Dropped my order and got the book from Aaron Hilegass "Cocoa Programming for Mac OS X"
It looks much better... I must admit
[ 02-17-2002: Message edited by: iNeusch ]
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2000
Location: Allston, MA, USA
Status:
Offline
|
|
Do either of these books work for someone whose knowledge of programming ends with copying BASIC programs out of A+ Magazine to run on his Apple II/e?
-- Jason
|
|
-- Jason
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Aug 2001
Location: Atlanta, Georgia, USA
Status:
Offline
|
|
Originally posted by jasong:
<STRONG>Do either of these books work for someone whose knowledge of programming ends with copying BASIC programs out of A+ Magazine to run on his Apple II/e?
-- Jason</STRONG>
It depends. Were they the BASIC programs that were in the articles or were they the Beagle Brothers code?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
Originally posted by jasong:
<STRONG>Do either of these books work for someone whose knowledge of programming ends with copying BASIC programs out of A+ Magazine to run on his Apple II/e?
-- Jason</STRONG>
From what I have read in these books, you better know at least C and an object oriented language (C++, Java). That is my case, so it is going easy...
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Sep 2000
Location: Netherlands
Status:
Offline
|
|
I'll tell you what i thought of O'reilly's
It is a nice book, with a nice learning curve. You'd better have some experience with JAVA if you ask me. That makes it a lot easier. C++ experience isn't necesarrily an advantage. But you can get there if you have no experience what so ever. It'll just take you a day longer to fully understand the syntax and way of thinking.
I had already started programming when i bought the book, and found out i had bought it a bit too late. Most of what was in there i already knew. It is good for the basics, but if you really want a reference or something like that, then keep looking.
I mostly use the net these days. And the omnigroup dev list. I'm now quite experienced with Cocoa. Only thing i want to spend time on from now on is learning a bit more about networking and the standard Darwin c-libraries. It seems there are quite some usefull tools in there that would really do good to some of my programs.
I also want to dive into CoreFoundation and the Frameworks. I need some expertise on those areas aswell.
DJ
|

Derk-Jan Hartman, Student of the University Twente (NL), developer of VLC media player
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
in Hilegass's "Cocoa Programming for MacOS X"...
did anyone manage to finish the challenge 2 of chapter 5 (page 119) ?
This one is giving me hard time...
Thanks !!
This is what I wrote 
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
- (IBAction)deleteEmployee  id)sender
{
NSNumber *anIndex;
int aRow;
NSEnumerator *e = [tableView selectedRowEnumerator];
while (anIndex = [e nextObject])
{
aRow = [anIndex intValue];
[employees removeObjectAtIndex:aRow];
[self updateUI];
}
}
</font>[/code]
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Louisiana
Status:
Offline
|
|
Originally posted by iNeusch:
<STRONG>in Hilegass's "Cocoa Programming for MacOS X"...
did anyone manage to finish the challenge 2 of chapter 5 (page 119) ?
This one is giving me hard time...
Thanks !!
This is what I wrote 
[Took code out]
</STRONG>
Yes, now I could give you the answer, or I could tell you how to figure it out on your own. Add this line in your while loop
NSLog(@"%@ %d", anIndex, aRow);
You should be able to figure out what you need to do from there.
I will give you a hint though, you need another variable.
jguidroz@mac.com if you still can't figure it out.
[ 02-21-2002: Message edited by: jguidroz ]
|
|
B&W G3/300 OS X 10.3 Server
AL G4/1.5 OS X 10.3
Next computer G5/3.X Ghz OS X 10.x.x
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
My variables get the good values...
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
<font color = blue>2002</font>-<font color = blue>02</font>-<font color = blue>22</font> <font color = blue>08</font>:<font color = blue>25</font>:<font color = blue>28.338</font> RaiseMan[<font color = blue>329</font>] <font color = blue>1</font> <font color = blue>0</font> <font color = brown>//Before</font>
<font color = blue>2002</font>-<font color = blue>02</font>-<font color = blue>22</font> <font color = blue>08</font>:<font color = blue>25</font>:<font color = blue>28.339</font> RaiseMan[<font color = blue>329</font>] Deallocation New Employee
<font color = blue>2002</font>-<font color = blue>02</font>-<font color = blue>22</font> <font color = blue>08</font>:<font color = blue>25</font>:<font color = blue>28.339</font> RaiseMan[<font color = blue>329</font>] <font color = blue>1</font> <font color = blue>1</font> <font color = brown>//After</font>
</font>[/code]
But I simply can't select multiple entries... that's what I can't figure out I think...
Thanks for your help 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
Originally posted by iNeusch:
<STRONG>
But I simply can't select multiple entries... that's what I can't figure out I think...
</STRONG>
That was an option in Interface Builder, I found it 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Louisiana
Status:
Offline
|
|
I'm pretty sure you were supposed to implement multiple selections through code because in a later chapter he says to go into interface builder and turn on multiple selections. Oh well.
|
|
B&W G3/300 OS X 10.3 Server
AL G4/1.5 OS X 10.3
Next computer G5/3.X Ghz OS X 10.x.x
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
There is still an error in your code. I actually just finished that challenge and I haven't really even started on the next chapter. Yes, you do have to turn on the option to be able to select multiple items in the Interface Builder (which he doesn't tell you anywhere in that chapter). You also need to heed his warning about objects moving in the array as you delete objects. Your code is very close. This is how I implemented it:
- (IBAction)deleteEmployee  id)sender
{
NSNumber *anIndex;
int aRow;
int number=0;
NSEnumerator *e = [tableView selectedRowEnumerator];
while (anIndex = [e nextObject])
{
aRow = [anIndex intValue];
[employees removeObjectAtIndex:[anIndex intValue]-number++];
}
[self updateUI];
}
personally, I believe it would be better to update the user interface outside of the loop, because it only needs to be updated once... so updating it inside the loop is just more CPU power that doesn't need to be used. The last update is all that matters as it's all that will actually be seen.
As far as the rest of the code is concerned, look at it and see if you can figure out why. This is one of those things that's really easy if you've been programming for a while, but hard to figure out at first. BTW... don't just copy and past it, because that would defeat the entire purpose. If you had JUST asked, I would have responded the same way as jguidroz, and I would not have told you. As your request has been up for a little while and you've had a while to stew over his recommendation, I'm putting mine up.
Specifically, consider what the additional variable was put in there for. You can use jguidroz' NSLog command to see why.
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
In fact, after jguidroz's answer I have spent a long time searching...
I had another implementation that didn't work (using the number of selected rows) so I emailed him 
I guess I was close, but not enough
Thanks for your help !
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
Here's the trick:
Suppose the following is a mutable array:
Location: 1 2 3 4 5 6
Item: A B C D E F
Suppose you want to delete items 4,5, and 6. In this specific example in the book, we would be given a list that says {4,5,6}.
First, we remove item 4:
Location: 1 2 3 4 5
Item: A B C E F
Notice there is still something in location 4. Also, notice that it is the original item 5, which is the next on the list to remove. So next, we remove item number (5-1), or number 4 (since we know that the next item in the list has been moved down one notch):
Location: 1 2 3 4
Item: A B C F
So, there is still something in location 4, and it's the original item 6. Our last thing to delete is item (6-2), or number 4, since we know that the next item in the list has been moved down two notches, since two items before it have already been deleted. So again, we remove item number 4:
Location: 1 2 3
Item: A B C
Does it make sense now why we have the additional variable?
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Louisiana
Status:
Offline
|
|
Actually Detrius, there is an error in your code as well. See, if you don't check to make sure there is one element always in the array, you could delete everything. True, I would always right a program where you can start clean, but with the way he was teaching the chapter with always keeping one element in the array, it's good to check for this.
|
|
B&W G3/300 OS X 10.3 Server
AL G4/1.5 OS X 10.3
Next computer G5/3.X Ghz OS X 10.x.x
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
Thank you for reminding me... I noticed that when I ran it, but didn't really care enough to fix it. I had forgotten about that requirement. It'll probably pop up somewhere later in the book...
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
Originally posted by Detrius:
<STRONG> Does it make sense now why we have the additional variable?</STRONG>
In fact it did before your first answer...
As I told you, I have worked with jguidroz and he has made everything clear to me !
Thanks for your help anyway
Solution :
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
- (IBAction)deleteEmployee  id)sender
{
NSNumber *anIndex;
int aRow;
int deletions = <font color = blue>0</font>;
NSEnumerator *e = [tableView selectedRowEnumerator];
while (anIndex = [e nextObject])
{
NSLog(<font color = orange>@"%@ %d"</font>, anIndex, aRow);
aRow = [anIndex intValue] - deletions;
<font color = brown>//only want to continue to delete if [employees count] > <font color = blue>1</font> </font>
if ([employees count] > <font color = blue>1</font>)
{
[employees removeObjectAtIndex:aRow];
deletions++;
}
}
</font>[/code]
[ 02-23-2002: Message edited by: iNeusch ]
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
I think that there is something wrong in Chapter 7.
AppController.h is not complete the way he described it...
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
<font color = brown>//</font>
<font color = brown>// AppController.h</font>
<font color = brown>// RaiseMan</font>
<font color = brown>//</font>
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
@class PreferenceController;
@interface AppController : NSObject
{
PreferenceController *preferenceController;
}
- (IBAction)showPreferencePanel  id)sender;
@end
</font>[/code]
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Louisiana
Status:
Offline
|
|
Go to www.bignerdranch.com and check out the errata on the book. He states that problem there, should be <Cocoa/Cocoa.h> instead of <Foundation/Foundation.h>.
|
|
B&W G3/300 OS X 10.3 Server
AL G4/1.5 OS X 10.3
Next computer G5/3.X Ghz OS X 10.x.x
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status:
Offline
|
|
Originally posted by jguidroz:
<STRONG>Go to www.bignerdranch.com and check out the errata on the book. He states that problem there, should be <Cocoa/Cocoa.h> instead of <Foundation/Foundation.h>.</STRONG>
Ok... sorry about that !
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|