O'Reilly Forums: Chapter 4 And Sdk 3.2 - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Chapter 4 And Sdk 3.2

#1 User is offline   abugida 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 04-February 10

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?
0

#2 User is offline   abugida 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 04-February 10

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];


0

#3 User is offline   auco 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 03-February 10

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
0

#4 User is offline   Szarik 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 30-March 10

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?
0

#5 User is offline   stan_siu 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 14-April 10

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.





0

#6 User is offline   zizazz 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 02-January 12

Posted 02 January 2012 - 02:40 PM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users