Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

HawaiiMacAddict

macrumors 6502a
Original poster
Dec 28, 2006
904
0
On one of my Macs of course
Aloha everyone,

I am working my way through Cocoa Programming for Mac OS X and have run into a major stumbling block. I've attached the screenshot from my program. Basically, I replaced a portion of one method with something almost identical, but the program no longer runs. Take a look at the attachment - can anyone see where I went wrong?

Mahalo in advance for your assistance,

HawaiiMacAddict
 

Attachments

  • Picture 2.png
    Picture 2.png
    43 KB · Views: 96

white89gt

macrumors regular
Jan 18, 2006
133
0
First of all, the following line is probably wrong.
Code:
otherButton:NSLocalizedString:nil
I don't know a lot about localized strings, but you're probably going to have to do something like this. This is uncompiled, so it may not be correct either.
Code:
otherButton:NSLocalizedString(nil, nil);

Secondly, you forgot a close parentheses in this line.
Code:
informativeTextWithFormat:NSLocalizedString(@"SURE_DELETE", @"Do you really want to delete %d people?", [selectedPeople count]];
 

HawaiiMacAddict

macrumors 6502a
Original poster
Dec 28, 2006
904
0
On one of my Macs of course
Aloha white89gt,

Thanks for the head's up on the missing paren. As for the first comment, I used nil in the commented out section (what was there previously) and it worked fine. When I completed the localization section, I had to modify the code. Instead of deleting the existing code, I simply commented it out and entered in the new code from the book. I also imported the Foundation class to the MyDocument.h file, but got the errors noted in the attached file.

HawaiiMacAddict
 

Attachments

  • Picture 1.png
    Picture 1.png
    44.9 KB · Views: 81

HawaiiMacAddict

macrumors 6502a
Original poster
Dec 28, 2006
904
0
On one of my Macs of course
Aloha white89gt,

I finally figured out the problem. In the line you originally noted as not having the closing paren, I had also typed 'NSLocalizedString' which was unnecessary. Once I took it out, everything works normally. Thanks for giving my code a once-over.

HawaiiMacAddict
 

white89gt

macrumors regular
Jan 18, 2006
133
0
No problem, and sorry I didn't catch the mis-spelling. When I saw the errors, I thought spelling might have something to do with it but I couldn't see that it was mis-spelled.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.