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

MorphingDragon

macrumors 603
Original poster
Mar 27, 2009
5,159
6
The World Inbetween
Im going through Cocoa Programming for Mac OS X by Aaron Hillegass and Im having trouble with one of the chapters. In the second chapter there is a number generator that spits out imaginary Lotto numbers but the debugger returns with a bunch of strings and terminates the App. Ive looked through and all the caps etc are correct and Im wondering if it is happening just because Im PPC.


[Session started at 2009-08-01 21:19:40 +1200.]
2009-08-01 21:19:41.160 lottery[8374:10b] *** -[NSPlaceholderString intWithFormat:]: unrecognized selector sent to instance 0x107450
2009-08-01 21:19:41.165 lottery[8374:10b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString intWithFormat:]: unrecognized selector sent to instance 0x107450'
2009-08-01 21:19:41.168 lottery[8374:10b] Stack: (
2441731472,
2455319788,
2441760600,
2441753940,
2441754600,
11692,
2530131516,
2441428196,
2441429600,
2441626256,
2530221564,
2530560232,
10856,
9928
)

The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to signal 5 (SIGTRAP).

Youll have to email me to get the project, uploading doesnt seem to work.
morphingdragon@gmail.com

(Im using the latest XCode BTW, 3.1.3. GCC4.2 compiles a heck of a lot faster)
 
Can you just paste the code in a post using CODE tags? Unless your project is thousands of lines, it should be managable.

-Lee
 
It is the same here:

Code:
result = [[NSString alloc] initWithFormat:@"%@ = %d and %d", 
                   [entryDate descriptionWithCalendarFormat:@"%B %A %e %Y"],
                   firstNumber, 
                   secondNumber];

Take a look what you have in the LotteryEntry.m and change to initWithFormat

/petron
 
You've got a typo. I've made the same mistake myself several times. Petron is right, all you need to do is change the typo from intWithFormat to initWithFormat.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.