1

Bonjour bonjour,

J'essaye de me mettre à la programmation iPhone, et j'ai pour cela acheté le livre "iPhone Application Development All-In-One for Dummies". Je ne suis pas sûr d'avoir eu raison... sorry

Bref, le premier programme (DeepThoughts, page 360 quand même) propose de faire défiler des phrases qui tombent du ciel (ça ça marche), et dans un 2e temps de faire la même chose avec une photo. Pour cela on crée une 2e instance de MainViewController qui s'appelle PhotoView, et on est censé pouvoir slider d'une vue (MainView) à l'autre.
Mon code compile, mais à l'exécution sur iPhone Simulator (4.2), j'obtiens ceci dans la console de debugger de Xcode:
2011-03-19 15:13:34.260 DeepThoughts[652:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<DeepThoughtsAppDelegate 0x4e41cc0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mainViewController.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00db3be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f085c2 objc_exception_throw + 47
2 CoreFoundation 0x00db3b21 -[NSException raise] + 17
3 Foundation 0x000346cf _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0003463d -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004b38d6 -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00d2a2cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004b22ed -[UINib instantiateWithOwner: options:] + 1041
8 UIKit 0x004b4081 -[NSBundle(UINSBundleAdditions) loadNibNamed: owner: options:] + 168
9 UIKit 0x002be943 -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002bf4ca -[UIApplication _runWithURL: payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
11 UIKit 0x002c9db2 -[UIApplication handleEvent:withNewEvent:] + 1533
12 UIKit 0x002c2202 -[UIApplication sendEvent:] + 71
13 UIKit 0x002c7732 _UIApplicationHandleEvent + 7576
14 GraphicsServices 0x016e9a36 PurpleEventCallback + 1550
15 CoreFoundation 0x00d95064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x00cf56f7 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x00cf2983 __CFRunLoopRun + 979
18 CoreFoundation 0x00cf2240 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x00cf2161 CFRunLoopRunInMode + 97
20 UIKit 0x002befa8 -[UIApplication _run] + 636
21 UIKit 0x002cb42e UIApplicationMain + 1160
22 DeepThoughts 0x0000274c main + 102
23 DeepThoughts 0x000026dd start + 53
) terminate called after throwing an instance of 'NSException'


Je ne sais pas du tout par où commencer? confus

A priori on dirait qu'il y a une méthode de mainViewController qui n'est pas "key value coding-compliant". Késako?

Merci de votre aide au cas où wink
avatar
Attention, nouvelle signature #eeek#
https://mastodon.ti-fr.com/@redangel