Jump to content


Photo

Chapter 4 And Sdk 3.2


  • Please log in to reply
5 replies to this topic

#1 abugida

abugida

    New Member

  • Members
  • Pip
  • 2 posts

Posted 04 February 2010 - 06:00 AM

Chapter 4 compiles without errors, but won't run on my iPhone simulator, with just the first edits, provided on pages 143 to 145, entered. The program opens and immediately shuts down. There's no output on the log.

I've tried the provided source code from O'Reilly and it doesn't run either. However, there is some crash report on the log:

CODE
2010-02-04 14:53:55.630 DrinkMixer[21300:207] *** -[NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x1905310
2010-02-04 14:53:55.631 DrinkMixer[21300:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x1905310'



I've checked Chapters 1 to 3 and 5 by me and/or O'Reilly which compile and run normally.

I have recently updated to SDK 3.2 beta, so I suppose it could be related to that? I've tried to compile against older SDKs (3.0, 3.1, 3.1.2) but that either doesn't work or I haven't figured out the right combination in XCode and the iPhone Simulator.

Any ideas?

#2 abugida

abugida

    New Member

  • Members
  • Pip
  • 2 posts

Posted 04 February 2010 - 07:01 AM

Little update: After we've moved the drink list into a plist file, the program runs fine. So I suppse something is wrong with this line in RootViewController.m (about line 22, as of pg. 145):

CODE
NSMutableArray* tmpArray = [[NSMutableArray alloc] initWithObjects:@"Caiphirina", @"Cosmopolitan", @"Mojito", @"Miami Vice", @"Zombie", "Pina Colada", @"Lemon Drop", @"Firecracker", nil];



#3 auco

auco

    New Member

  • Members
  • Pip
  • 4 posts

Posted 04 February 2010 - 12:50 PM

QUOTE (abugida @ Feb 4 2010, 07:01 AM) <{POST_SNAPBACK}>
… @"Zombie", "Pina Colada", @"Lemon Drop", ...


Hi,

the "@" is missing before "Pina Colada" ;-)

Best,
Michael

#4 Szarik

Szarik

    New Member

  • Members
  • Pip
  • 1 posts

Posted 30 March 2010 - 03:51 PM

I am actually trying to load .plist file and I am getting

Expected expression before "@" token.

on

NSString *path = [[NSBundle mainBundle] pathForResource:@”ProductList” ofType:@”plist”];
NSMutableArray *tmpArray = [[NSMutableArray alloc] initWithContentsOfFile:path];

Does anyone have a clue?

#5 stan_siu

stan_siu

    New Member

  • Members
  • Pip
  • 4 posts

Posted 15 April 2010 - 11:07 PM

QUOTE (abugida @ Feb 4 2010, 06:00 AM) <{POST_SNAPBACK}>
Chapter 4 compiles without errors, but won't run on my iPhone simulator, with just the first edits, provided on pages 143 to 145, entered. The program opens and immediately shuts down. There's no output on the log.

I've tried the provided source code from O'Reilly and it doesn't run either. However, there is some crash report on the log:

CODE
2010-02-04 14:53:55.630 DrinkMixer[21300:207] *** -[NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x1905310
2010-02-04 14:53:55.631 DrinkMixer[21300:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x1905310'



I've checked Chapters 1 to 3 and 5 by me and/or O'Reilly which compile and run normally.

I have recently updated to SDK 3.2 beta, so I suppose it could be related to that? I've tried to compile against older SDKs (3.0, 3.1, 3.1.2) but that either doesn't work or I haven't figured out the right combination in XCode and the iPhone Simulator.

Any ideas?



If you read to page 174, you would know the crash is intentional as the subsequent pages talk about debugging.






#6 zizazz

zizazz

    New Member

  • Members
  • Pip
  • 1 posts

Posted 02 January 2012 - 02:40 PM

In the Second Edition, see page 188 rather than page 174




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users