Apples's Scrolling Example Crashes - iphone

I am trying to run the Apple's Scrolling Sample Code, but I get following Error:
Scrolling[45877:207] Unknown class ScrollingAppDelegate in Interface Builder file.
Scrolling[45877:207] Unknown class ScrollingViewController in Interface Builder file.
Scrolling[45877:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UICustomObject 0x4b33330> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key viewController.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00f0cbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x010615c2 objc_exception_throw + 47
2 CoreFoundation 0x00f0cb21 -[NSException raise] + 17
3 Foundation 0x000306cf _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0003063d -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004af8d6 -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00e832cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004ae2ed -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004b0081 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002ba943 -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002bb4ca -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
11 UIKit 0x002c5db2 -[UIApplication handleEvent:withNewEvent:] + 1533
12 UIKit 0x002be202 -[UIApplication sendEvent:] + 71
13 UIKit 0x002c3732 _UIApplicationHandleEvent + 7576
14 GraphicsServices 0x01842a36 PurpleEventCallback + 1550
15 CoreFoundation 0x00eee064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x00e4e6f7 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x00e4b983 __CFRunLoopRun + 979
18 CoreFoundation 0x00e4b240 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x00e4b161 CFRunLoopRunInMode + 97
20 UIKit 0x002bafa8 -[UIApplication _run] + 636
21 UIKit 0x002c742e UIApplicationMain + 1160
22 Scrolling 0x0000279c main + 102
23 Scrolling 0x0000272d start + 53
)
terminate called after throwing an instance of 'NSException'
The weird thing is, that I can't find those connections in the MainWindow.xib (The only xib file). The Outlets are properly connected to the AppDelegate and MyViewController classes.

The Runtime cannot find a way to create an instance of the classes "ScrollingAppDelegate" and "ScrollingViewController", which are serialized in the xib file. So it defaults to UICustomObject, which you don't have either.
Are you sure those classes exist in your source file(s) and that they are compiled correctly (i.e., part of the "Compile" build phase)?
Also check the spelling and the capitalization of the classes. It has to match between the xib files and the source files.
If something is wrong, there could be a yellow warning dot in the xib file (bottom-right). Click it for more info.
Finally, the sample code is marked as iOS4+. Do you have iOS 4 on your device?

Related

Accidentally deletion of classes from XCode 3.2.5 ...Please help me Please

Accidentally my classes folder is deleted with reference from xcode(project). I try to recover them from trash but it was not present in trash. how ever I used svn for backup. but after check out the whole project when i try to run the project then it gives an error
2012-06-05 12:58:14.299 Lisnx[1285:207] Unknown class LisnxAppDelegate in Interface Builder file.
2012-06-05 12:58:14.301 Lisnx[1285:207] Unknown class LisnxViewController in Interface Builder file.
2012-06-05 12:58:14.304 Lisnx[1285:207] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key viewController.'
* Call stack at first throw:
(
0 CoreFoundation 0x0119dbe9 exceptionPreprocess + 185
1 libobjc.A.dylib 0x012f25c2 objc_exception_throw + 47
2 CoreFoundation 0x0119db21 -[NSException raise] + 17
3 Foundation 0x000756cf _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0007563d -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004f48d6 -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x011142cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004f32ed -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004f5081 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002ff943 -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x003004ca -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
11 UIKit 0x0030adb2 -[UIApplication handleEvent:withNewEvent:] + 1533
12 UIKit 0x00303202 -[UIApplication sendEvent:] + 71
13 UIKit 0x00308732 _UIApplicationHandleEvent + 7576
14 GraphicsServices 0x01ad3a36 PurpleEventCallback + 1550
15 CoreFoundation 0x0117f064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52
16 CoreFoundation 0x010df6f7 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x010dc983 __CFRunLoopRun + 979
18 CoreFoundation 0x010dc240 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x010dc161 CFRunLoopRunInMode + 97
20 UIKit 0x002fffa8 -[UIApplication _run] + 636
21 UIKit 0x0030c42e UIApplicationMain + 1160
22 Lisnx 0x00002528 main + 102
23 Lisnx 0x000024b9 start + 53
)
terminate called after throwing an instance of 'NSException'
Please some body help me to way out from this problem. I will be thankful for him.
You most likely just deleted the Reference of the Classes. Look in your project folder to make sure they are still there. If they are, just copy them back to your project browser.
As long as you didn't choose Move to Trash when you got the dialog then you are Okay. If you chose Remove References, then the files are still in your project folder on your computer, look there first before anything else.
Remove References only means that Xcode will remove the classes or files from your project and NOT delete them to the trash.
I just get-read of this exception easily. just going in project navigator right click on it then add file from existing source.adding all these classes and build it it successfully worked.

Why is my iPhone app crashing with the exception "Could not load NIB in bundle"?

I am learning how to make iPhone apps in the simulator but my app crashes as soon as it launches in the simulator. Also, there are no errors and no warnings when I compile the source code.
Here is a copy of the console logs -
2011-10-27 04:49:08.376 login[1192:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'LoginView''
* Call stack at first throw:
(
0 CoreFoundation 0x00dc85a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f1c313 objc_exception_throw + 44
2 CoreFoundation 0x00d80ef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d80e6a +[NSException raise:format:] + 58
4 UIKit 0x004b30fa -[UINib instantiateWithOwner:options:] + 2024
5 UIKit 0x004b4ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
6 UIKit 0x0036a628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
7 UIKit 0x00368134 -[UIViewController loadView] + 120
8 UIKit 0x0036800e -[UIViewController view] + 56
9 login 0x000029c3 -[loginViewController viewDidLoad] + 165
10 UIKit 0x004b2f26 -[UINib instantiateWithOwner:options:] + 1556
11 UIKit 0x004b4ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
12 UIKit 0x002ba17a -[UIApplication _loadMainNibFile] + 172
13 UIKit 0x002bacf4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
14 UIKit 0x002c5617 -[UIApplication handleEvent:withNewEvent:] + 1533
15 UIKit 0x002bdabf -[UIApplication sendEvent:] + 71
16 UIKit 0x002c2f2e _UIApplicationHandleEvent + 7576
17 GraphicsServices 0x01720992 PurpleEventCallback + 1550
18 CoreFoundation 0x00da9944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
19 CoreFoundation 0x00d09cf7 __CFRunLoopDoSource1 + 215
20 CoreFoundation 0x00d06f83 __CFRunLoopRun + 979
21 CoreFoundation 0x00d06840 CFRunLoopRunSpecific + 208
22 CoreFoundation 0x00d06761 CFRunLoopRunInMode + 97
23 UIKit 0x002ba7d2 -[UIApplication _run] + 623
24 UIKit 0x002c6c93 UIApplicationMain + 1160
25 login 0x00002694 main + 102
26 login 0x00002625 start + 53
)
terminate called after throwing an instance of 'NSException'
I have tried and tried and can't seem to fix this problem. I will appreciate any help.
Your app is trying to load a file called LoginView.xib, and failing to. Seems like this file is referenced from your MainWindow.xib (or whichever is your main nib file as defined in your application plist). Check that this file exists, is copied to the bundle (in the copy resources build phase). If that's the case you can try cleaning the project, restarting xCode and trying again (I had this problem occasionally, for no apparent reason when switching between iPhone/iPad targets).

facing exception after removing tab bar from app

I added UITabBarController in my app but removed after some time. App was working fine before adding UITabBarController but when I removed it from app, I started facing below exception.
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<XpensesAppDelegate 0x4daaa40> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tabBarController.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00fa45a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x010f8313 objc_exception_throw + 44
2 CoreFoundation 0x00fa44e1 -[NSException raise] + 17
3 Foundation 0x00035677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x000355e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004b930c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00f1a8cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004b7d23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004b9ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002bf17a -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002bfcf4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
11 UIKit 0x002ca617 -[UIApplication handleEvent:withNewEvent:] + 1533
12 UIKit 0x002c2abf -[UIApplication sendEvent:] + 71
13 UIKit 0x002c7f2e _UIApplicationHandleEvent + 7576
14 GraphicsServices 0x018fc992 PurpleEventCallback + 1550
15 CoreFoundation 0x00f85944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x00ee5cf7 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x00ee2f83 __CFRunLoopRun + 979
18 CoreFoundation 0x00ee2840 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x00ee2761 CFRunLoopRunInMode + 97
20 UIKit 0x002bf7d2 -[UIApplication _run] + 623
21 UIKit 0x002cbc93 UIApplicationMain + 1160
22 Xpenses 0x00001ad9 main + 121
23 Xpenses 0x00001a55 start + 53
24 ??? 0x00000001 0x0 + 1
)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Any solution to get rid of this exception?
You have something connected to the tabBarController outlet of your app delegate in Interface Builder. However the outlet no longer exists, so you're getting this error. You should just find and remove that connection.

iPhone app crashes on startup

I had two apps in xcode, which i wanted to combine, so i started a new project and attempted to put the two apps together in this new one. Was this a really stupid thing to do?
The app now crashes on start up and i have no idea why, i'm 99% the outlets are all connected. It uses xcdatamodel for storage and i've imported the right framework.
Can anyone think of any other things that could be going wrong?
I can attach a zip file with the project in if someone wouldn't mind having a look
Any help is massively appreciated!
Thanks
This is the stack trace:
2010-11-02 08:18:59.903 iStalker[34745:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x5b10e20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key textField.'
*** Call stack at first throw:
(
0 CoreFoundation 0x0256f919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x026bd5de objc_exception_throw + 47
2 CoreFoundation 0x0256f851 -[NSException raise] + 17
3 Foundation 0x0003bc2b _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0003bb99 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004b5d0a -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x024e5b6f -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004b4721 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004b64b5 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002c59bb -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002c690d -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 198
11 UIKit 0x002d0452 -[UIApplication handleEvent:withNewEvent:] + 1958
12 UIKit 0x002c9074 -[UIApplication sendEvent:] + 71
13 UIKit 0x002cdac4 _UIApplicationHandleEvent + 7495
14 GraphicsServices 0x02dd5afa PurpleEventCallback + 1578
15 CoreFoundation 0x02550dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x024b1737 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x024ae9c3 __CFRunLoopRun + 979
18 CoreFoundation 0x024ae280 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x024ae1a1 CFRunLoopRunInMode + 97
20 UIKit 0x002c6226 -[UIApplication _run] + 625
21 UIKit 0x002d1b58 UIApplicationMain + 1160
22 iStalker 0x00001b50 main + 102
23 iStalker 0x00001ae1 start + 53
)
terminate called after throwing an instance of 'NSException'
Looks like you have a text field connected to the application delegate in your main XIB. There is no such field defined on the real application delegate, which is why you’re getting the error.
Thats because you set main xib for app in info plist and set File Owner to appDelegate, while main xib file's owner is always UIApplication. Possible solution - add Object to .xib, set its class for appDelegate class and connect all unnecessary outlets. This worked for me.

NSObject doesNotRecogniseSelector crashes program

I am learning how to develop iPhone applications and I ran into an interesting problem. In my view controller class, I have a an int variable that I #synthesize and overload the setter (though) this is not needed. When I run the application, I get this trace back:
*** Call stack at first throw:
(
0 CoreFoundation 0x024e0919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0262e5de objc_exception_throw + 47
2 CoreFoundation 0x024e242b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02452116 ___forwarding___ + 966
4 CoreFoundation 0x02451cd2 _CF_forwarding_prep_0 + 50
5 Awesome App 0x00001ff1 -[Controller refreshView] + 69
6 Awesome App 0x00002180 -[Controller awakeFromNib] + 133
7 UIKit 0x004a3924 -[UINib instantiateWithOwner:options:] + 1556
8 UIKit 0x004a54b5 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002b49bb -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002b590d -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 198
11 UIKit 0x002bf452 -[UIApplication handleEvent:withNewEvent:] + 1958
12 UIKit 0x002b8074 -[UIApplication sendEvent:] + 71
13 UIKit 0x002bcac4 _UIApplicationHandleEvent + 7495
14 GraphicsServices 0x02d46afa PurpleEventCallback + 1578
15 CoreFoundation 0x024c1dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x02422737 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x0241f9c3 __CFRunLoopRun + 979
18 CoreFoundation 0x0241f280 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x0241f1a1 CFRunLoopRunInMode + 97
20 UIKit 0x002b5226 -[UIApplication _run] + 625
21 UIKit 0x002c0b58 UIApplicationMain + 1160
22 Awesome App 0x00001e4c main + 102
23 Awesome App 0x00001ddd start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
My attention got drawn to line 2. This happens when I try to assign an int value to my class iVar. Please can you tell me what the problem is and how to fix this?
Thanks a million.
Well, yeah. The default implementation of doesNotRecognizeSelector: is supposed to kill your program. That's not the problem. The problem is that you're sending an object a message it can't respond to. In this case, it looks like Controller can't respond to the message refreshView.
Let the exception be thrown and let the program crash on the uncaught exception. The exception contains all the information you need. You should see a log line that identifies the target of the method invocation and what method (that doesn't exist) was trying to be invoked.