My recent changes in NIB file is not displayed in ios simulator-closed - iphone

I've applied changes in interface builder for my app which has labels in it. I just changed the name and position of a label and in addition to that I changed the font of a text view in my app. When I started to run my app, the font remains the same as previous one and none of the labels are displayed in it.
Can anyone help it pls?

in Xcode try this: main menu:product:Clean
if not enough: main menu:Xcode:preferences: -> click over locations icon:
click over the little gray right arrow for derived data:
that will show you the finder folder "DerivedData": delete it.
one other thing to try: in simulator, delete your app.

quite your xcode and then again open your project . Clear your build then run your code.

You should also make sure, that the interfacebuilder file is linked to the target you are starting in simulator.
To do this, select your xib and open the File inspector. There you should see a dropdown named "Target Membership" where you can link the xib to the targets you want.
Also be sure to have the labels defined as IBOutlets in your header file and link them correctly in your xib. Easiest way to do this is using the Assistant Editor and drag the outlet to the header file.

I had the same problem - but only on the iPhone non-retina in the simulator. Cleaning the code did not help. Restarting and rebooting did not help. But removing the app from the simulator worked. Now changes to my UI show up next time I run.
To remove the app from the simulator I did it just like on a real phone. I select the app icon with the mouse and hold it down the mouse button for a few seconds. Then the icon displays a small delete icon that you can select (the app icons shakes too).

Related

Xcode Base internationalization doesn't work

I'm trying to localize my app.
I noticed that if I add a language every localized file become doubled.
In this way it's impossible to maintain code or storyboard so I learnt that I need Base internationalization.
The problem is that when I select that checkbox in xcode project setting it shows a window without nothing to select, does anyone know how to fix this?
Here's a screenshot
First, you need to go to your storyboard file, open the bar on the right side, and go to Show the File Inspector, the furthest tab to the left. Then, scroll down and click localize. After this, when you check Use Base Localization, you should see the storyboard appear.
This could happen if Base Internationalization was active before then disabled and files deleted manually.
Create Base.lproj folder in your project folder using the finder.
Move your main story board to it also using the finder.
fix the reference to it from Xcode.
remove app. from device, clean & build your project.
All will be back to normal.

Xcode puts Default.png in my plist as an Icon file when I assign a Launch Image

When I set a Launch Image, Xcode creates a copy as Default.png and creates an entry in my plist in Icon Files (iOS 5) / Primary Icon / Icon Items --> Item 1 : Default.png
Item 0 : MyIcon.png is the app icon which I have already placed through the Target.
The reason this is a problem is that the launch image then takes precedence over the actual icon and as a result, it shows as the primary icon instead of my actual icon image.
Why is Xcode doing this?
Can I safely delete the Default.png entry from my .plist? (this seems to fix the problem)
Do I need to copy Default.png somewhere else?
Thanks!
There is also an alternate way. Follow this simple step:
Just delete the Default.png file. Select it again in the summary section project's target settings. you can also drag drop it the on the icon of launch image in the summary section.
The answer is that if you are developing and app for iOS 5, there are two different sections for declaring your icons. The Info editor in the Project editor doesn't show the iOS 5 section. You have to load the file in the Property List editor.
Basically for pre-iOS 5 there is 'CFBundleIconFiles', for iOS 5+ it's 'CFBundleIcons'
Make sure that these have the same icon files names in them.

Why can't I add a child pane plist file into my project's Settings.bundle?

I'm running Xcode 4.1 and I've been following a tutorial about app settings. Everything has been going great up until I get ready to add a plist for a child pane that I want to add.
The video tutorial I'm watching (also using Xcode 4.1) shows the guy right-clicking the settings.bundle and choosing Add File... and then saving a file named More. In the video tutorial, he ends up with a More.plist showing up in the project and also in the settings.bundle right in the same level with the Root.plist. I just get it in the project. Nothing in the settings.bundle, and I can't figure out how to copy it there.
I've also noticed that in the tutorial, in the Project Navigator, the settings.bundle has an icon that looks kind of like an outline of a shield. In my Project Navigator, the settings.bundle looks like a white sheet of paper with a corner folded down.
Anyone know what the heck is going on?
FWIW, the root app settings works fine in the simulator. I can see the stuff I set up just fine. I can click on the link to my child pane and it switches to it, but nothing that I added in the more.plist shows up there.
Any help GREATLY appreciated!!
Argh, Apple tends to change things without letting anyone know. The whole settings bundle thing is just not well integrated into XCode if you ask me.
If you ever try to localize your application, you will find that you have to manually add the localization folders to the settings.bundle.
Looks like we have to do the same thing to add child menus now, as just adding the plist file does not put it into the settings.bundle.
Here is the set of steps I just tried that worked.
Open up finder, you can right click or two finger click Settings.bundle and choose "Show in Finder".
Right click Settings.bundle in the finder window, choose show package contents.
Copy the new plist file into this the settings.bundle next to the Root.plist
Delete the new plist from the main project.
I was not able to get the text field to show up under additional .plist page.
My Fix:
Leave only 1 Child.plist file outside Settings.bundle
Navigate to Root.plist
Right click and select 'Show Ray Keys/Values'
Right click and select 'Add Row'. Add:
Key: File
Type: String
Value: Root
In Xcode 4.3.2,
Right click the Project Name in the Project Navigator, and choose Show in Finder.
In Finder, right click the setting.bundle and choose Show Package Contents.
Copy the new .plist to setting.bundle.
Back to XCode, open the setting.bundle, wilfully add one item under the Preference Items, then expand it and modify the value of Type to Child Pane.I can't upload the image, so give the link of the blog.
This problem still exists in Xcode 4.2. Creating and moving [child].plist in Finder does help thanks to John S up there.
Some additional tips.
Make sure to turn on "Show Raw Keys/Values" by right clicking inside the opened root.plist file for the "ChildPane Type" to appear. Also make sure to select "Property List Type" as "iPhone Settings plist". If you're having trouble with ordering items, just open the plist file in a text editor and move the xml elements around accordingly.
Additional additional tip: in Xcode 4.2 to explore/expand the contents of the bundle make sure to set its type to Application Bundle (via File Inspector Menu).
Same issue, waste my almost 1 hour.
1st make sure your plist format is correct.
My solution:
Delete you bundle, and re-build & run.
Now everything is fine...

Xcode 4 .xib Create iPad Version

I have an iPhone xib I want to turn into an iPad xib. In Xcode 3 there was a "Create iPad Version" menu option. How do I do this in Xcode 4?
I currently resized my xib, but when I turn on the simulated items (Navigation Bar, etc.) it shrinks the view back down to iPhone size.
This worked for me:
Make a copy of the .xib in the Finder.
Open the copied file in a text editor.
Change "com.apple.InterfaceBuilder3.CocoaTouch.XIB" to "com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB".
Change all instances of "IBCocoaTouchFramework" to "IBIPadFramework".
Search for sizes like {480, 320} and edit them. Or just reopen the file in Xcode and use the GUI to resize items as needed.
This also works in reverse, if you need to change an iPad xib into an iPhone xib.
in Xcode 4 it's quite hidden, but the option to convert XIBS in the app still exists.
Select the target (in XCODE4 it's shown when you select the project). Once selected use the contextual menu to "Duplicate" it. It will ask if you want to "Duplicate and transition to iPad". Then all the XIBS will be duplicated with the new iPad size.
On assessing my options, these were my thoughts:
Too much of a hassle to install xcode 3 and downgrade project
Don't want to mess with .xib file format - afraid it might break something that will show itself much later
Copying the same nib is imperfect (see the explanations in this thread)
So finally, what I ended up doing that works fine is:
Create a new file, choose "UIViewController derived" class
Check the "intended for iPad" checkbox
Name the file -iPad
Delete the .h and .m corresponding to the uiviewcontroller
Now populate the new nib with the same objects, structure and connections as the original nib
Check if on iPad, if so then load the new nib else load the old nib
The feature has been removed from Xcode 4.
Right now the easiest way is to use Xcode 3 for the conversion, since the nib (.xib) file format did not change.
Xcode 3 & 4 can now be both installed on the same system by simply selecting a different folder (see installation instructions on the disk image).
Another simple way in XCode4 is: Just copy the iPhone XIB in Finder; drag the copy in your project. Open the copied XIB in XCodes build in interface builder. Change the size of the top view in your NIBs hirarchy to iPads dimensions (e.g. 1024x748 for landscape with statusbar) - everything else resizes according to the autoresizing masks.
Works perfect for me.
If you make a new nib, it will ask you if it should be sized for iPad. That might be the easiest unless you've already done a bunch of work on it.
You will have to use the older version of Interface Builder to use the "Create iPad version using autoresizing masks". There currently is no option in Xcode 4 that will do this.
Using XCode 4, all you have to do is select the (iPhone-specific) .xib file in the project navigator, then select File... --> Duplicate...
Name the new .xib file the same as your iphone-specific one, but append ~ipad to the name. All your previous connections in the view hierarchy should be unchanged in your brand-new iPad-specific .xib file.
You can use this tool I made, based on the answer from "arlomedia":
http://iphone.dizzystudios.net/ConvertToiPad
just give it the iPhone xib path

iPhone simulator isn't showing splash screen

All I have to do to show a splash screen in a view-based application is drag an image into the resources folder and name it default.png, correct? This is what I did, but the image doesn't show.
When you added it, did you tell it to copy to output location? It was a checkbox on the dialog that showed up after you added it. Try readding and make sure this checkbox is checked.
UPDATE from comments: a clean build fixed the problem
It sounds like what you are doing is correct, but reading through the documentation might help you work out what the problem is.
Perhaps your Default.png is not in the root of your bundle? To check, expand the Products section in the Groups & Files panel, then select Reveal in Finder from the context menu. Then right click on the app bundle in Finder, and select Show Package Contents. You should see your Default.png listed there.