iphone-sdk-3.0

How to format NSDate?

让人想犯罪 __ 提交于 2019-11-27 21:42:53
How can I get my NSDate to display in the format for example i.e "Tue Feb 26, 2011" Matthias Bauch Do it right. Don't hardcode your date formats. There are countries that are not your country and they might have different date formats. So if you want to show this date to the user you should use a method that takes the users locale into account. You could use the dateFormatFromTemplate:options:locale: method introduced in iOS4 to get the appropriate format with all the information you want. And if you have to support iOS < 4 you should create a plist with this template method to create the

iPhone : Transfer of files from Mac/Pc to app

放肆的年华 提交于 2019-11-27 21:27:32
问题 I need to transfer binary files from my pc/mac to my app. I want to allow my users to upload sound files. Am i going to have to run a web server that the user can connect to over wifi? What are the steps i have to go through to get this up and running? 回答1: In my apps, I use the open-source cocoahttdserver. It is quite trivial to setup in your app and connect to from a computer using the same network. They have an iPhone sample project that you can pretty much cut and paste from for basic

How do I add custom pins to the iPhone MapKit?

删除回忆录丶 提交于 2019-11-27 21:22:14
I'm testing out the MapKit framework on the iPhone and would really much like to switch the standard pin that displays a location to an image called "location.png". How can I modify my code to allow that? Maincontroller - (void)viewDidLoad { [super viewDidLoad]; // // Set the map center // CLLocationCoordinate2D coordinate; coordinate.latitude = 49.2802; coordinate.longitude = -123.1182; mapView.region = MKCoordinateRegionMakeWithDistance(coordinate, 2000, 2000); // // Set 10 random locations on the map for testing purposes // for(int i = 0; i < 10; i++) { CGFloat latDelta = rand()*.035/RAND

how use google api in iphone to query hotels around my place

柔情痞子 提交于 2019-11-27 20:19:41
I am new to google apis and iphone LBS related apps. I need to know how to use a google api and get the list of hotels around my GPS location. Here the same functionality is achieved through javascript. how to do this on iphone application ? http://code.google.com/apis/ajax/playground/#localsearch_with_markers Did you try - http://code.google.com/apis/maps/documentation/places/#PlaceSearches ? It looks like a normal webservice, you can just post a request and it should give you an XML / JSON list of all the hotels around you .. From the website - Request = http://maps.google.com/maps/api/place

iPhone OS: Tap status bar to scroll to top doesn't work after remove/add back

半城伤御伤魂 提交于 2019-11-27 20:18:14
Using this method to hide the status bar: [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; When setting "hidden" back to NO, the tap-to-scroll-to-top (in UIWebView, UITableView, whatever) doesn't work any more, and requires a restart of the app to get the functionality back. Is this a bug (I filed a rdar anyhow) or have I missed a step? Should I perhaps expect this behavior since the statusBar "loses touch" somehow with the respective view? You could try setting the ScrollsToTop property to true again after re-showing it: [currentView setScrollsToTop:YES]; If that's not

Hide/Show iPhone Camera Iris/Shutter animation

≯℡__Kan透↙ 提交于 2019-11-27 19:32:19
I am not able to Hide the iphone Camera shutter opening animation for my app. I am using UIImagePickerController to access iphone camera and using my own overlay controllers. Is there a way to remove the initial shutter(also known as Iris) animation as the camera starts. Thank You [EDIT] For those who wants to know the way to change the camera iris animation. The below function is called before the camera iris animation starts. - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { // Here

Changing UITableViewCell textLabel background color to clear

三世轮回 提交于 2019-11-27 18:48:17
In my app I have a table view with customViewCells. I subclassed the UITableViewCell class and added an image that will load async and for the text I use cell.textLabel.text = @"someThext" . For the cells the background color is set alternatively to [UIColor darkGrayColor] and [UIColor whiteColor] . When I run the app in the simulator and on the phone the textLabel of the cell has the background white. I want to set it to be clear, because I want the background color of the cell to be full not a strip then white then another strip. In the init method of my custom cell I added, hoping that the

How to hide a section in UITableView?

喜夏-厌秋 提交于 2019-11-27 18:47:05
There are some section in the table that does not contain any data and would like to hide that section. How to do this? 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 Actually, you can "hide" a section. If you want to use a similar behaviour to the built-in contacts app, where sections are

How to create contacts in address book in iPhone SDK?

北城余情 提交于 2019-11-27 18:37:26
How to create contacts in address book in iPhone SDK? malinois ABAddressBookRef addressBook = ABAddressBookCreate(); // create address book record ABRecordRef person = ABPersonCreate(); // create a person NSString *phone = @"0123456789"; // the phone number to add //Phone number is a list of phone number, so create a multivalue ABMutableMultiValueRef phoneNumberMultiValue = ABMultiValueCreateMutable(kABMultiStringPropertyType); ABMultiValueAddValueAndLabel(phoneNumberMultiValue, phone, kABPersonPhoneMobileLabel, NULL); ABRecordSetValue(person, kABPersonFirstNameProperty, @"FirstName" , nil); /

wait_fences: failed to receive reply: 10004003 - what?

微笑、不失礼 提交于 2019-11-27 18:36:38
问题 Been getting this odd error. heres the deal - in the below method i have an alert view come up, take a U/N and PW, then atempt to start another method. The method -postTweet does not get activated I just get this error in console wait_fences: failed to receive reply: 10004003 Which is really odd - as ive never seen it before - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ if (alertView == completeAlert ) { if (buttonIndex ==1) { passPromtAlert = [