Xcode Crashes when making any changes to a XIB - iphone

I am very new to Xcode and I am starting with some tutorials I found online. There is one screen I am trying to edit and when I change anything about the XIB (IE: even relocate a label), XCode crashes with the following error. What can be causing this?
Thank you!!
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 5A3005
ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilder/IDEInterfaceBuilder-4514/Framework/Document/IBDocument.m:2551
Details: An instance of IBUILabel with object ID 6 did not archive its child (IBUITextField) with an object of ID 7.
Object: <IBCocoaTouchDocument: 0x7fbddf2e4b70>
Method: -documentArchiver:didArchiveObject:
Thread: <NSThread: 0x7fbdd9408530>{name = (null), num = 1}
Hints: None

Finally figured it out! Turns out that if I use my OLD Mac running Lion, Xcode can edit the XIB without an issue. I can then save it to my new Mac and it works fine in the new project!!

Related

macOS App different behaviour between Development and Release versions

I created a macOS app which, upon pressing a button, launches another NSWindow with a WKWebView inside. While developing the app and launching it via the "Run" button in Xcode the WKWebView loads fine and displays the web page. But when I archive the app and export it as a .app file and run it independently from Xcode it does not load the WKWebView and only shows an empty NSWindow.
Does anyone know what the problem could be here?
Thanks a lot and best regards
EDIT:
I tested to launch another NSWindow with a ViewController in it and a simple label. This works fine. Here is the code:
myWindow = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: nil).instantiateController(withIdentifier: "testWindow") as? NSWindowController
myWindow?.showWindow(self)
As soon as I replace the label with an empty WKWebView, the application now crashes when testing without Xcode. In Xcode it launches fine.
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000017781d5f58a0
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [5905]
VM Regions Near 0x17781d5f58a0:
__LINKEDIT 0000000114a12000-0000000114a39000 [ 156K] r--/rwx SM=COW /usr/lib/dyld
-->
MALLOC_NANO 0000600000000000-000060000339a000 [ 51.6M] rw-/rwx SM=ZER
I just figured it out, the problem was linking, I needed to add webkit to linked libraries in build phases and now it works fine.

Build works for iOS 7, but crashes in iOS 6

I've been making an app and only testing in iOS 7 simulator until now, and I wanted to try and build for iOS 6, to see if it looks good. Problem is, I get a mysterious crash when I build for iOS 6. iOS 7 is still just fine, but iOS 6 doesn't start. The file editor goes to main.m, and the debugger shows this:
2014-03-10 21:45:55.481 Can'Art 2014[4479:907] -[UINavigationController interactivePopGestureRecognizer]: unrecognized selector sent to instance 0x797d720
2014-03-10 21:45:55.483 Can'Art 2014[4479:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationController interactivePopGestureRecognizer]: unrecognized selector sent to instance 0x797d720'
*** First throw call stack:
(0x179d012 0x15c2e7e 0x18284bd 0x178cbbc 0x178c94e 0xbb5b 0x814817 0x814882 0x814b2a 0x82bef5 0x82bfdb 0x82c286 0x82c381 0x82ceab 0x82cfc9 0x82d055 0x9323ab 0x78392d 0x15d66b0 0x424fc0 0x41933c 0x424eaf 0x8228cd 0x76b1a6 0x769cbf 0x769bd9 0x768e34 0x768c6e 0x769a29 0x76c922 0x816fec 0x763bc4 0x763dbf 0x763f55 0x76cf67 0x730fcc 0x731fab 0x743315 0x74424b 0x735cf8 0x2928df9 0x1720f3f 0x172096f 0x1743734 0x1742f44 0x1742e1b 0x7317da 0x73365c 0xb23d 0x264970d)
libc++abi.dylib: terminate called throwing an exception
I've been searching for errors in my project, and everything I've found up until now is that in Copy Bundle Resources, in Build Phases, Main.storyboard is red. I assumed this means that it can't localize the Main.storyboard file, but readding the references and readding it to the Copy Bundle Resources didn't work. It also stays red when building for iOS 7, even though it works fine.
Stacktrace says, that you are trying to use interactive pop gesture which is not available in iOS6.
You can use respondsToSelector: to check if your instance can send such kind of message.
For ex.
if ([self.navigationController respondsToSelector:#selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.delegate = self;
}

iPhone exception handling crash my app

I am new on ios and i am following a tutorial to develop a calculator.
When i build my project it succeds, but on run time it crashes and throwa an exception:
`2012-09-19 10:03:51.469 AhsanCalculator[325:f803] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x6d59870> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key pushOperand.'
*** First throw call stack:
My code is here if you need more detail. Tell me what you need and i will give you all the details.
Xcode = 4.3.3
5.1 iPhone simulator
Please help to solve this issue
The crash occurred for you is because, in your xib you have linked/connected some wrong objects, i mean a UITextField to a UITextView or some thing like that.
When you open Xib right clicking on the files owner object, it shows some of the IBOutlets connected with a warning icon, delete those and connect to the right/correct one.
This will clear your crash, and works fine.
As you are new to iOS development, here are some link to learn about what to when a crash appears in the project,
Its is by Raywenderlich, here it is a 2 part tutorial part 1 and part 2.

Crash application in iPad but not in iPhone

Good morning,
I have an application that run well on iPhone but crash to launch in iPad and don't understand the problem.
Crash incident:Hardware Model: iPad3,3
Process: SardinianPirates1 [20569]
Path: /var/mobile/Applications/BD12D72A-B8BC-4443-B866-8B632211A467/nameofapp.app/nameofapp
Identifier: nameofapp
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-04-11 15:41:24.829 -0700
OS Version: iPhone OS 5.1 (9B176)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/BD12D72A-B8BC-4443-B866-8B632211A467/nameofapp.app> (loaded)' with name 'MainWindow-iPad''
*** First throw call stack:
(0x31f9e88f 0x367f3259 0x31f9e789 0x31f9e7ab 0x32d9f437 0x32da094d 0x32cd6509 0x32b5f893 0x32b598d7 0x32b27c6b 0x32b2770f 0x32b270e3 0x3595322b 0x31f72523 0x31f724c5 0x31f71313 0x31ef44a5 0x31ef436d 0x32b58a13 0x32b55e7d 0xfbdef 0xfbda8)
This is my Xcode error log when launch the iPad simulator
2012-04-12 07:53:50.556 nameofapp[16337:10a03] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/myname/Library/Application Support/iPhone Simulator/5.1/Applications/E8655CDA-1E4F-41CB-B3C7-9A5B7BFF13A6/nameofapp.app> (loaded)' with name 'MainWindow-iPad''
*** First throw call stack:
(0x1c1a022 0x1905cd6 0x1bc2a48 0x1bc29b9 0x5bb638 0x5bceb7 0x399ce1 0x399ff8 0x39917f 0x3a8183 0x3a8c38 0x39c634 0x2312ef5 0x1bee195 0x1b52ff2 0x1b518da 0x1b50d84 0x1b50c9b 0x398c65 0x39a626 0x25a7 0x2541 0x1)
terminate called throwing an exception(lldb)
Any idea for help me?
Thank you
It's saying that it expects to find a file called MainWindow-iPad in your application bundle. Look in your Target settings under Summary, iPad Deployment Info. As Radrider33 says, this may also be requested by your app delegate.
There are three different ways you can choose to fix this:
If your app UI is precisely designed for the iPhone screen size, go to Summary, iOS Application Target and set Devices to iPhone. On the iPad, your app will run in an iPhone-shaped window, with the usual 2x button. This is the least work, but has the ugliest results.
If your iPhone UI makes good use of autosizing masks, you can set the iPad Main Interface or Main Storyboard filename to match the iPhone / iPod version. Everything view will be fitted to the larger iPad screen based on its masks.
If you want to redesign your UI for the iPad (most work, but Apple would rather you do this), create an appropriate set of files in Interface Builder. Either name the window MainWindow-iPad, or change the iPad Main Interface file to match whatever file you create.
Change your project's default window settings.
and also check your ios version of ipad
Check your project settings. Your app is trying to loan an xib with file name " MainWindow-iPad" and cannot. Be sure that everything is correct in both your app delegate as well as your project's default window settings.

simulator blackberry 9550 not launching

Anyone know.. what is this? "jvm error 104 uncaught classcastexception" this message shown in my simulator simulator blackberry 9550? thanks.
I believe that an Exception is occurring when you are trying to cast an object with a class.. I had a similar issue and that was the problem I found.
You haven't shown a single line of code, but I'll hazard a guess: you're trying to cast an object to a type which it does not subclass.