iphone-sdk-3.0

Addressbook Save Image for contacts programmatically

心已入冬 提交于 2019-12-06 15:45:12
I am creating an addressbook application in that all the data are stored to server and when User will ask then server will restore all the contacts to iPhone. My problem is how to send Image to server as well as how I will be able to restore the contact Image , I came to know that my server will provide me an Image in base64 encryption format. So can any help me how to perform image saving and retrieving for Addressbook Programmatically You need to convert the base64 image in nsdata and then you can set it to a contact, check "ABPersonSetImageData" in following code. ABRecordSetValue(newPerson

Getting wrong orientation

蹲街弑〆低调 提交于 2019-12-06 14:54:38
问题 I am having an issue in my application which drives me mad. In my application, I rotate the simulator to the landscape mode, but in my below function, I get portrait orientation. What is the problem here? Please help me out. -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if ( interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ) { NSLog(@" portrait orientation"); } else { NSLog

how to avoid dots next to a uitextfield

↘锁芯ラ 提交于 2019-12-06 14:18:40
Is that possible to remove the dots which are displayed next to uitextfield when text is larger than the width of the uitextfield. There is a property lineBreakMode which defines the behaviour when the text to be displayed is larger than the box of the control //UILineBreakMode //Options for wrapping and truncating text. typedef enum { UILineBreakModeWordWrap = 0, UILineBreakModeCharacterWrap, UILineBreakModeClip, UILineBreakModeHeadTruncation, UILineBreakModeTailTruncation, UILineBreakModeMiddleTruncation, } UILineBreakMode; If you do not want any dots you can use UILineBreakModeClip which

How to play a video from an URL in iphone

試著忘記壹切 提交于 2019-12-06 13:45:26
I have a video at in url, In a button click I have to play a video, for this I used UIWebView to play this video, for this I used the following code: -(void)viewDidLoad { NSString *string = @"http://www.boxmusiq.com/ThiruvasakamVideo/VTS_01_2_converted.mp4"; youtubeview = [[YouTubeView alloc] initWithStringAsURL:string frame:CGRectMake(0, 0, 320, 480)]; NSLog(@"the url is: %@",string); [self.view addSubview:youtubeview]; } and In YouTubeView.m YouTubeView is a subclass of UIWebView; - (YouTubeView *)initWithStringAsURL:(NSString *)urlString frame:(CGRect)frame; { if (self = [super init]) { //

Adding Smileys to UITextView or UITextField

a 夏天 提交于 2019-12-06 13:15:42
Can any body guide me to add smileys to UItextField or UITextView? As v get in iChat view which is also editable u can add/remove it as v have for iChat in Desktop. Eg: Hello :) (this is smiley) Thanks Veena KingofBliss Use the following code: NSRange range = {NSNotFound, 0}; NSString *s = @"This is a smiley :)"; range.location = 0; range.length = [s length]; s = [s stringByReplacingOccurrencesOfString:@":)" withString:@"\ue415" options:NSCaseInsensitiveSearch range:range]; 来源: https://stackoverflow.com/questions/1389379/adding-smileys-to-uitextview-or-uitextfield

UITableView slow, even with just a few objects?

允我心安 提交于 2019-12-06 12:55:42
问题 - (void)viewDidLoad { [super viewDidLoad]; [self.tableView setRowHeight:100]; [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; [self.view setBackgroundColor:[UIColor groupTableViewBackgroundColor]]; } #pragma mark - #pragma mark Table view data source // Customize the number of sections in the table view. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *

The graphical elements of UIKit – what format are they?

假装没事ソ 提交于 2019-12-06 12:54:45
问题 For standard interface elements of the Apple's UIKit, how do apple store them? Are they stored as cocca touch code, pdf, images or other? Thanks Ross 回答1: The graphics are stored in crushed PNG format in an 'artwork' file in UIKit. In a more general sense they are, of course, not just graphics - but can be likened to images painted in touch-receptive boxes. 来源: https://stackoverflow.com/questions/2593972/the-graphical-elements-of-uikit-what-format-are-they

How can I determine a CLLocation or MKPlacemark from an address?

眉间皱痕 提交于 2019-12-06 12:35:34
问题 I've seen API documentation and demo after demo on how to do a reverse geocode - to get an address, given a Lat/Long location. I need to do the reverse. I'm assuming that this is already solved problem since Apple's MapKit API avoids it entirely. 回答1: One way is to use the google webservice like so: -(CLLocationCoordinate2D) addressLocation { NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", [addressField.text

How to send images to a web service?

久未见 提交于 2019-12-06 12:33:00
问题 Hey, can anyone post a sample code demonstrating how can images (jpeg, png) be posted on a local web service. Sayeed 回答1: First google hit would probably help you. 回答2: Here is a code snippet - - (void)useImage:(UIImage*)theImage { /* turning the image into a NSData object getting the image back out of the UIImageView setting the quality to 90 */ NSData *imageData = UIImageJPEGRepresentation(theImage, 90); // setting up the URL to post to NSString *urlString=[SiteUrl stringByAppendingString:@

Iphone sequential animation with setAnimationDelay

谁说我不能喝 提交于 2019-12-06 12:08:30
I'm trying to chain animation events. The application I'm coding for work has a multiple choice quiz. First you pick your multiple choice answer. The quiz view fades away. Then a label ("correct" or "incorrect") fades in and then fades out. Finally the quiz fades back in again. The events are called and handled by a main viewController. I know I can chain events with the setAnimationDelegate and setAnimationDidStopSelector but I think it'll be easier and more clear to simply use setAnimationDelay so that all animations have time to finish before the next one fires. I made this function that