iphone-sdk-3.0

How to create contacts in address book in iPhone SDK?

青春壹個敷衍的年華 提交于 2019-11-27 04:18:42
问题 How to create contacts in address book in iPhone SDK? 回答1: 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,

iPhone StoreKit - invalid product id's

社会主义新天地 提交于 2019-11-27 04:11:43
问题 I'm trying to test In App Purchase within the sandbox environment. In order to test the code I did the following: Created an In App Purchase Test User account under 'Manage Users' in iTunes Connect Created some in app purchase products under 'Manage Your In App Purchases'. I used numeric values and alpha-numeric values for the Product IDs. Loaded the app onto the iPhone, went to Settings->Store and logged out of the regular store and into the test account created in step 1 Set a breakpoint in

How to download PDF and store it locally on iPhone?

给你一囗甜甜゛ 提交于 2019-11-27 04:03:01
问题 I am able to successfully view a PDF from a website. I want to be able to download that PDF to the device, then access that file locally. When the app is opened, it will check the online PDF's date. If it is newer than the locally-stored PDF, the app will download the new one, otherwise it opens the locally-stored PDF. The code I am currently using: PDFAddress = [NSURL URLWithString:@"http://www.msy.com.au/Parts/PARTS.pdf"]; request = [NSURLRequest requestWithURL:PDFAddress]; [webView

IPHONE: Analyzing leaks with instruments

◇◆丶佛笑我妖孽 提交于 2019-11-27 03:48:27
问题 I am trying to locate leaks using instruments, but the leaks I see there are like the ones in the next picture: leaks As you can see there's no information of which line of code is exactly leaking. All leaks I have, around 20, are like this, or in other words, the leaks don't show any line of my code in particular. The leak in this picture is related to "_CFAllocatorSystem" (???) on the CoreFoundation and I have others that simply say GSEvent. I have no clue of what's generating these. How

How to solve “Application failed codesign verification” when uploading to iTunes Connect?

三世轮回 提交于 2019-11-27 03:39:56
I've got a problem that I couldn't solve with a deep search in different resources as most of the "similar" points out to be an error with Icon.png size, etc... I've tried to upload my application after verifying that: Correctly builds and run on my device That my certificates are installed properly That my certs / profiles are not expired. That the Icon.png has the proper size and format of 57x57 PNG. And several other things. Ran codesign --verify -vvvv MyApp.app which worked fine. My ZIP File was properly done When I've tried to upload through the iTunes connect interface I got the simple

Iphone SDK : Send Email in background in iphone app

十年热恋 提交于 2019-11-27 03:37:18
问题 Iphone sdk : how to send an email in background from an iphone app. Based on certain selections made by the user I want to trigger an event to send an email to an admin. I am aware of the MFMailComposeViewController but this will open the mail composer window which I want to skip. 回答1: You will need to use a third party library for that. The SDK doesn't allow you to send emails in the background. Here's one you can use: http://code.google.com/p/skpsmtpmessage/ 回答2: This is an old question,

iPhone speech recognition API? [duplicate]

戏子无情 提交于 2019-11-27 03:26:18
This question already has an answer here: iPhone App › Add voice recognition? [closed] 4 answers The new iPhone 3GS has support for voice commands, stuff like "call Bill" or "play music by the strokes" and whatnot. I was looking through the iPhone SDK, but I cannot find any references to this capability. All of the search keywords I choose seem to only find the new voice chat functionality. Does anyone know whether Apple has added voice command APIs to the SDK, or whether it's yet another forbidden API? If it does exist, could someone point a particular class out to me? The SDK does not

MPMediaItems raw song data

别等时光非礼了梦想. 提交于 2019-11-27 02:51:45
I was wondering how to access an MPMediaItem's raw data. Any ideas? MIchael you can obtain the media item's data in such way: -(void)mediaItemToData { // Implement in your project the media item picker MPMediaItem *curItem = musicPlayer.nowPlayingItem; NSURL *url = [curItem valueForProperty: MPMediaItemPropertyAssetURL]; AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL: url options:nil]; AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset: songAsset presetName: AVAssetExportPresetPassthrough]; exporter.outputFileType = @"public.mpeg-4"; NSString *exportFile = [[self

iPhone - How do you make a resizable rectangle for cropping images?

谁说胖子不能爱 提交于 2019-11-27 02:05:25
问题 I'm having a trouble making a re-sizable rectangle for cropping my images. I'm trying to achieve something like this picture: http://img192.imageshack.us/img192/8930/customcropbox.jpg Well, the only problem is I have no clue where to actually start. I need some advice to how I can achieve this effect of cropping. What documentation should I read up on? Core Graphics or Quartz 2d? Both? I've been coding for the iPhone since it's release date but I've never actually used core graphics and etc.

How to set selected segment index in UISegmentedControl?

早过忘川 提交于 2019-11-27 02:03:01
问题 I'm trying to avoid an app crash here... I have a button that will remove a segment from a UISegmentedControl. If that button is pressed and the user has the segment to be removed selected, the segment will remove and no selection will be highlighted. However, when another button is pushed that does an action that retrieves the selectedSegmentIndex, the app crashes. In short: Is there any way to force the selection of a segment in a UISegmentedControl? edit it seems as though the