Why are there two places to specify the App Icon File? - iphone

The App Icon File is defined in the plist as well as in the Info Tab of the target.
Is there any reason for this or is it just redundant?

This is just two different places for the exact same setting. Changing it at one place will change it in the other location.
The same is true for the "Bundle Identifier", "Version" and "Build" fields in the Summary tab, which will change the values in the Info.plist.
Actually quite every piece of information present in the "Summary" tab is just another way to present common information present in the Info.plist file, it is just a more readable presentation of the exact same info. And same for the "Info" tab, which present the Info.plist keys directly, and extract some special keys like Document Types, UTIs and URL Types in a separate view: everything in there is just another presentation of the Info.plist file too.
Special note for the "Icon" attribute: there are various ways to define the application icons in the Info.plist keys due to evolution across the various SDKs. And the icon in the "Summary" tab only affect the latest way to define icons.
At start there was only one key CFBundleIconFile of type string that defined a unique icon name. Simple enough.
Then another key CFBundleIconFiles has been added to accepted a list (NSArray) of icons, to support multiple resolutions and usages (Search icon, etc)
Finally, in iOS5, another key was introduced again called CFBundleIcons that is now a dictionary that allows you to list each icon file and its associated purpose (Newsstand icon, Search icon, App Icon…)
For more details, read the Information Property List Key Reference which explains the differences in detail.

Removing the items in one place causes them to be removed at the other place as well. So I guess it is redundant. Also dragging and dropping the icon files into the "App Icons" slots under the target's "Summary" tab achieves the same effect.

Related

Building Blocks not appearing after upgrade to Word 2013

I have a document-level (dotx) customization, with a custom ribbon, and one of the controls in that ribbon is this:
<gallery idMso="CustomGallery1" label="Building Blocks" size="large" />
The only other part that makes this work is the creation of entries under Custom1 in the Building Blocks Organizer. In Word 2010, this would show all the building blocks under the Custom1 category. In Word 2013, it shows the name of each building block briefly, and then all of them are removed and the list is empty:
The building blocks themselves all contain either a document property or document variable.
I have tried the following to resolve this but without success:
Ensured that they are still present by opening the template outside of Visual Studio; they are.
Upgraded the template to the 2013 dotx format.
Re-created the building blocks.
Re-created the entire dotx file, and then re-created the building blocks.
I also tried using other ribbon IDs, they are empty too (they do all have entries) but they display it differently:
There should be four entries there, they exist in my Normal.dotm. The last two controls there, for equations and content controls, do work, except the content control that is inserted displays similar behavior as the Autotext gallery:
I don't know what should be shown in this case but I doubt it's nothing.
Right now I'm assuming that this is just a broken feature in 2013 and will have to replace it with something else. Does anyone know anything to the contrary?
I don't think it is a broken feature, after some struggle, I did get to understand how to use it:
The gallery button in the "toolbar" of a newly added Building Block Gallery Content Control indeed seems empty at first, because it is set to list QuickParts. You have to change it in the properties of the control so that it lists the content of the AutoText Gallery instead (or any other Gallery of Building Blocks you'd like). To do so, either directly click on the Properties button in the Developper tab while the control is selected, or switch to Design Mode so that the Properties appears in the context menu (right-click on the control):
AutoText is "Insertion automatique" in French, the rest you can guess ;)
As far as I could find, it's just a broken feature. There's also a ridiculous memory leak the first time you do a Find and add fields during that find.

How to add button to settings.bundle?

I'm developing an iPhone app, and by default user keeps logged in. If he wants to logout, he should open the Settings and click a "Logout" button which would erase his data and ask for a login the next time app is opened. How do I add a button like this? As in twitter settings
As CodaFi said it is not possible. However it could be a good workaround to use a toggle switch for "keep me logged in". And when the user turn it off you can show the login screen on next launch.
Unfortunately, this is not possible using public APIs. Bear in mind that Apple reserves many, many undocumented (and exceedingly cool) features for it and it's partner's applications. You are limited to only the following:
Text field: The text field type displays a title (optional) and an
editable text field. You can use this type for preferences that
require the user to specify a custom string value. The key for this
type is PSTextFieldSpecifier.
Title: The title type displays a
read-only string value. You can use this type to display read-only
preference values. (If the preference contains cryptic or nonintuitive
values, this type lets you map the possible values to custom strings.)
The key for this type is PSTitleValueSpecifier.
Toggle switch: The
toggle switch type displays an ON/OFF toggle button. You can use this
type to configure a preference that can have only one of two values.
Although you typically use this type to represent preferences
containing Boolean values, you can also use it with preferences
containing non-Boolean values. The key for this type is
PSToggleSwitchSpecifier.
Slider: The slider type displays a slider
control. You can use this type for a preference that represents a
range of values. The value for this type is a real number whose
minimum and maximum value you specify. The key for this type is
PSSliderSpecifier.
Multivalue: The multivalue type lets the user select
one value from a list of values. You can use this type for a
preference that supports a set of mutually exclusive values. The
values can be of any type. The key for this type is
PSMultiValueSpecifier.
Group: The group type is for organizing groups
of preferences on a single page. The group type does not represent a
configurable preference. It simply contains a title string that is
displayed immediately before one or more configurable preferences. The
key for this type is PSGroupSpecifier.
Child: pane The child pane type
lets the user navigate to a new page of preferences. You use this type
to implement hierarchical preferences. For more information on how you
configure and use this preference type, see “Hierarchical
Preferences.” The key for this type is PSChildPaneSpecifier.
If you don't mind using the 3rd-party add-on "InAppSettingsKit" for your app's Settings, then it looks they would allow you to do what you need. I'm currently studying up on this myself, but from a quick scan through their documentation it looks like they would allow you to add buttons as well as completely custom child pane views: http://www.inappsettingskit.com/
On that page, study the sections "IASKButtonSpecifier" and "Custom Viewcontrollers".
I'll post a follow up here to let you know how this worked out for me. I'm using the InAppSettingsKit already, and love it so far.
Download the code and sample app from Github: https://github.com/futuretap/InAppSettingsKit
Then open the InAppSettingsKit.xcworkspace in your XCode and study how they implemented the various different types of Settings entries. They definitely support what you are looking for. It's really quite impressive.
Erik

iPhone Settings Bundle - Read-only setting

Is it possible to have a read-only setting (from the user's perspective, but read/write from my app) in the settings bundle. I'm looking to display something like:
Registered: YES/NO
But I don't want to show a switch because I don't want the user to be able to change this.
The title type displays a read-only string value. You can use this type to display read-only preference values. (If the preference contains cryptic or nonintuitive values, this type lets you map the possible values to custom strings.)
The key for this type is PSTitleValueSpecifier.
No.
For the app to have read write ideally it needs to be in the Settings.bundle which goes into the Documents folder. You could just disable user interaction on the switch?
In Xcode 4+ set the type to title of the textfield.

iPhone plist file versions... Adding keys sometimes does not work

I created an iPhone project using the Core Data template. Now when I try to change my plist file to "Status bar is initially hidden = YES" I can't find that key in my options. Instead I find a lot of keys that are relevant to Core Data, keys that I've never seen before.
Anyway, I add the key "Status bar is initially hidden" myself and set it to a Boolean value and then tick. But just doesn't work. The status bar is there.
Are there many versions or types of property list files for the iPhone? What do the available keys depend on? And finally, how can I achieve what I want? :)
Try adding the key "UIStatusBarHidden" and set it to true. That's the name that is used internally in the plist when "Status bar is initially hidden" is set.

How to add a label in a settings screen

As a picture says more than a thousand words:
alt text http://img.skitch.com/20091008-k16k7we3t43gj3h7htgtjpunpx.jpg
Any help on how to add descriptive labels to a settings pane would be highly appreciated!
I should point out that I want to do this to be in the iPhone-App settings that are in the Settings menu of the iPhone (outside the App).
Example label:
iPhone -> Settings -> Safari -> Fraud Warning
The label beneath: "Warn when visiting fraudulent websites."
For reference: Since iOS4.0 and above a FooterText key was added to PSGroupSpecifier that does exactly what you are looking for.
http://developer.apple.com/library/ios/documentation/PreferenceSettings/Conceptual/SettingsApplicationSchemaReference/SettingsApplicationSchemaReference.pdf (pg 11)
Unfortunately, Apple has not given iPhone developers the capability to add the kind of label you're looking for in Settings.app. As a near approximation, I've used PSGroupSpecifier under another setting element (such as PSToggleSwitchSpecifier). It's not as elegant as a true label, but it worked well enough in my situation (I only had one setting, so it didn't conflict with any other group headings).
alt text http://pseudorandomengineer.com/images/6.png
Try using a PSTitleValueSpecifier in your settings bundle's plist. I'm not sure how that formats itself—most likely bold, like the group headers—but it might be what you're looking for.
If you want to simulate a label that is center-justified, add an empty title PSGroupSpecifier and put your label text in the FooterText Key.
Check out the tableView:titleForFooterInSection: method of UITableViewDataSource. You can return a string to be displayed below a table view section. If you're already using a UITableViewController subclass, just implement that method and you're good to go.