iphone-sdk-3.0

How to hide a section in UITableView?

蹲街弑〆低调 提交于 2019-11-26 19:36:17
问题 There are some section in the table that does not contain any data and would like to hide that section. How to do this? 回答1: You can't "hide" a section as such, but you can "delete" it from the table view using the deleteSections:withRowAnimation: method. This will remove it from the view, with an optional animation, without affecting your backing data. (You should, however, update the data anyway so that the section doesn't reappear.) More info: UITableView class reference 回答2: Actually, you

declaring global variables in iPhone project

做~自己de王妃 提交于 2019-11-26 19:16:19
问题 how can i declare a global NSArray and then use it across my app? 回答1: There are a couple different ways you can do this: Instead of declaring it as a global variable, wrap it in a singleton object, then have the singleton by available anywhere (by #importing the .h file) Create a .h file, like "Globals.h". In the .h, declare your array as extern NSMutableArray * myGlobalArray; Then in the somewhere else in your app (the AppDelegate is a good place), just do: myGlobalArray = [[NSMutableArray

UIView doesn't resize to full screen when hiding the nav bar & tab bar

你离开我真会死。 提交于 2019-11-26 18:55:18
问题 I have an app that has a tab bar & nav bar for normal interaction. One of my screens is a large portion of text, so I allow the user to tap to go full screen (sort of like Photos.app). The nav bar & tab bar are hidden, and I set the the text view's frame to be full screen. The problem is, there is about 50px of white space where the tab bar used to be. You can see if from this screen shot: removed dead ImageShack link I'm not sure what's causing this. The whitespace is definitely not the view

How can my server securely authenticate iPhone in-app purchase?

六月ゝ 毕业季﹏ 提交于 2019-11-26 18:47:16
问题 Look at Apple's diagram for the server purchase model. In step #9, how can the server know that it is really talking with an iPhone that is entitled to the purchase, and that Eve is not performing a replay with a dishonestly obtained receipt? The receipt may be valid, but that doesn't prove that the sender is the entitled party. Is there any notion of a device certificate on the iPhone that can be used to sign the receipt? Is there any way to bind the receipt to the device, or bind the

How to detect when keyboard is shown and hidden

戏子无情 提交于 2019-11-26 18:42:47
How can I detect when the keyboard is shown and hidden from my application? In the ViewDidLoad method of your class set up to listen for messages about the keyboard: // Listen for keyboard appearances and disappearances [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil]; Then in the methods you specify (in this case keyboardDidShow and keyboardDidHide ) you can do

Data Formatters temporarily unavailable

你。 提交于 2019-11-26 18:27:05
问题 Im trying to use Date Formatters (NSDateFormatter), but I keep getting this error: Program received signal: “EXC_BAD_ACCESS”. Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib") 回答1: This is nothing to do with NSDateFormatter - the message pasted in saying "Data Formatters" is correct. You will get this message in several situations, possibly most commonly when unable to find a

UITextField for Phone Number

只愿长相守 提交于 2019-11-26 18:23:04
I was wondering how I can format the textField that I'm using for a phone number (ie like the "Add New Contact" page on the iPhone. When I enter in a new mobile phone, ex. 1236890987 it formats it as (123) 689-0987.) I already have the keyboard set as the number pad. zingle-dingle Here is my solution.. works great! Formats the phone number in realtime. Note: This is for 10 digit phone numbers. And currently it auto formats it like (xxx) xxx-xxxx.. tweak to your hearts delight. First in your shouldChangeCharactersInRange you want to gather the whole string for the phone text field and pass it

Temporarily Lock or Disable iphone home button

﹥>﹥吖頭↗ 提交于 2019-11-26 18:21:47
问题 I know the iphone home button is extremely crucial for the functioning of the iphone. However I have an idea for which I need the application running and the home button to be disabled. I tried googling, but haven't been able to find a solution. Temporary or timed locking (Lock for 5/10 mins.) would also do. The app. should work on non-jailbroken phones, hence going around apple won't work. Appreciate any ideas. 回答1: Note, from 2014 onwards: just to be clear, this is now built in to iOS...

How to change Xcode Project name

你说的曾经没有我的故事 提交于 2019-11-26 17:56:09
问题 I have developed my app in Xcode for iPhone, in start I have just named it without secnec now I want to change my app name I have replace my old app name with new one as I have found the name in my app, but its still giving me one error... Desktop/New name/old name_Prefix.pch: No such file or directory when I have change oldname_prefix.pch with newname_prefix.pch .. 回答1: For Xcode 4 or later: Open a project Select Project Navigator Highlight project name Single click on project name For Xcode

Push-Notification Badge auto increment

一个人想着一个人 提交于 2019-11-26 17:37:21
问题 I've been implementing the push service to my application, and I've been thinking about the application's badge. My app is a mail app (sorta) and I want to notify the user via push for new messages added to the inbox, I want the badge = number of new messages in the inbox. I thought of doing it server sided (provider) checking for new messages and sending the number as the badge. The question is: Is there a way to auto-increment the application's badge, without having to calculate the badge