Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 10    Views: 140

Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
04/30/14 07:57 AM (10 years ago)

(To plugin Developers) XIB problems BT 3.0

if I use myPlugin.xib which is iPhone when I get my package. I fill it with button and labels. Then I add a new xib file myPlugin~iPad and fill this with buttons and labels When I run this on iPhone everything is ok when I run this on iPad I get the iPhone xib interface in iPad simulator. I deleted my both xib files and I create new xib view for iPad and I gave it myPlugin.xib I fill this with buttons and labels and I run it on iPad sim everything works great. Now I add a new xib view for iPhone file myPlugin~iphone.xib fill this and try to run it then I have my iPad xib interface in my iPhone sim. What is the problem to have two xib files??
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/30/14 09:44 AM (10 years ago)
I'm still learning this process myself. Trying to add ~iPad XIB's to Instant Database Creator. I find the same problem as you... if adding the ~iPad to the file name on the new xib, it still seems to show the iphone version. If creting both in a blank project, it seems to work perfectly. Makes no sense. Apple and stackoverflow documentation says to simply create a new xib with ~iPad after the name.... I'm still working on the xib designs and layout for now, then once all finished I planned on looking up what the issue is so I can just pop them in, but I'll be keeping an eye on this thread in case any other developers can chime in on what could be causing the problem.
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
04/30/14 10:33 AM (10 years ago)
After you create a new ~iPad.xib and name it with the same class, you still need to- 1) Set the "Files Owner" to your custom class. 2) Connect the "view" to the Files Owner.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/30/14 10:35 AM (10 years ago)
Doh! of course! :) Thanks Atrain
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
04/30/14 10:55 AM (10 years ago)
this prefix ~ipad works on BT 1.5 and 2.0 but now in 3.0 it will not work any more. It is strange!
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/30/14 11:17 AM (10 years ago)
It should work fine in 3.0. Make sure you do as Atrain says.
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
04/30/14 11:26 AM (10 years ago)
@chris1 it does not work. it is obvious that I have linked view to the correct controller. I've done this a thousand times but now it does not work anymore. as long as I have one xib file does it work well both as xib iPad or iPhone xib. But the file called myPlugin.xib works fine and I put in another one named myPlugin~iPad.xib then I get into myPlugin.xib interface in my ipad simulator. and I do it the other way then it will be the same.
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
04/30/14 04:02 PM (10 years ago)
I have several BT 3.0 apps with custom xib files for both iphone and iPad and I agree with Chris1 that it does indeed work. If you have the xib button menu plugin you can see that it works. Josh
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/30/14 05:45 PM (10 years ago)
Mackimack - feel free to send me your project folder via Dropbox and I'll take a look. Probably something simple. The reason I say it "works" for 3.0 is that there's nothing in the Buzztouch code that deals with loading xib files for small vs large devices. That's all handled natively by iOS.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/02/14 10:48 AM (10 years ago)
Any luck MachiMack? I'm still not getting it to work either. I'm using my shark attack plugin as an example. My file that works for iphone is AN_SharkAttack.xib, so I added a new file (a view file, setup as ipad), and named it AN_SharkAttack~iPad.xib. I set the file owners class to AN_SharkAttack and connected teh view to file owner. It's still loading the iphone XIB in the the simulator for ipad and ipad retina. We must be missing a step somewhere. Is there any kind of code we need to use in the viewdidload to say "if ipad then..."?
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
05/02/14 11:02 AM (10 years ago)
@angry ninja Send the package too chris and see if he can fix it. I have not fix it yet. Im using Xcode version 5.0.2 if it is the problem. If chris fix it I want to now chris Xcode version. Maybe I need to upgrade it.
 

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.