Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
10/26/12 07:36 AM (13 years ago)

App crashing after adding iPad view XIB

Hello gang, I'm working on a plugin, and following David's tutorial (again), but this time I'm having a problem. I've added a XIB file with an iPad (only) view, and added a few IB items to it. Xcode is happy with all my code (IBOutlets, Synthesizes, methods, etc), but when I go to run the program the main menu loads. And when I select the row item for the plugin I'm testing, Xcode crashes with a "SIGABRT". Here are the last lines in the console: 2012-10-26 10:33:31.211 mobitest[54518:207] BT_rotatingNavController: pushViewController 2012-10-26 10:33:31.211 mobitest[54518:207] BT_rotatingNavController: pushViewController for screen: 6DADA43F608E7916DC2D5C0 Current language: auto; currently objective-c When I first added the plugin (before creating the XIB), the menu would lead to the blank view as expected. But now, I can get to the new screen. Any help would be appreciated, as always!
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
10/26/12 07:49 AM (13 years ago)
After further testing, it may not be specific to the ipad XIB.... I added an iphone XIB to the project, and made all the appropriate connections. And it crashes at the same spot (when its trying to load the plugin screen).
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
10/26/12 08:02 AM (13 years ago)
Have you add the ipad xib to files owner ? Have you select right class? In you viewContrller .m have you deletet the method there you load bt_utillitys. I dont sit with my Mac now. So I dont now What that the name is on the method.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
10/26/12 08:13 AM (13 years ago)
Yes about the file owner and selecting class. And are you talking about the configureBackgroundandNavBar? That's still at the top of the .m file. If I comment that out, the app still crashes, but before trying to push the viewController.
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
10/26/12 08:14 AM (13 years ago)
does the XIB file match your class name EXACTLY? does your .m file have a - (id) initwithNibName method in it? (not sure it is needed, i'm still trying to figure out how David loads xibs without using that. i never could!)
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
10/26/12 08:21 AM (13 years ago)
yes, the name is exact. And, I didn't add the -(id) initwithNibName, but I haven't used that on any of my other plugins. Maybe the connection made in IB does that for us?
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
10/26/12 08:44 AM (13 years ago)
it must. but i still use the initwithNib name in my code and the xib loads right up. getting the ipad xib to load instead of the iphone one, that i've not seen work as smoothly as David did in that video... but that's not the issue you're having, correct? When one of my xibs' won't load and it SIGABARTS, I usually delete it and start over. the files owner can get corrupted apprently. I generally create mine using the new file, new subclass and make the whole class and include the xib. then i modify the .h and .m that xcode made. I don't use the .h .m that BT made. I'm not sure if that makes a difference but it usually works better for me. you can also open the XIB and look at it's source - it''s just XML. highlight it and say Open As, Source you can verify the class is correct in there. also look for the IBIPadFramework string and make sure that is correct. seems like some of those other strings in that file must help tie it all together.
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
10/26/12 09:17 AM (13 years ago)
@Stobe Have you solved the problem? I try a to setup a new xib to iPad now. First you have to name it right + add this ~Ipad. Then go to ipd xib file mark the files owner connect class. I hope you have add a View. mark the view and connect it to files owner.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
10/26/12 09:48 AM (13 years ago)
Working now. Thanks Macimack and ATRAIN Ok, here's what I learned... (for future readers to learn from) 1. I used BT's .m and .h files created from the plugin creator 2. I used the File..New..View..Blank in Interface builder to create my iPad XIB (at first, I only needed ipad xib, I added iphone later for testing. 3. I named the ipad xib the same as my .m and .h files 4. Apparently if you use both ipad and iphone XIBs, you can name them: classname.xib and classname~iPad.xib OR classname~iPhone.xib and classname.xib I guess either the iphone OR ipad XIB needs to be noted if you are using 2 5. (Thanks to Mackimack's last post) Don't Forget to connect your View to the File Owner!!! I had all my buttons, and images linked, but forgot to link my view! Now I just have to learn what I can about: handleTapToLoadScreen Thanks everyone!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.