iphone-sdk-3.0

How to Add Core Data to an existing Utility Application

别等时光非礼了梦想. 提交于 2019-11-27 11:23:14
问题 I´ve created an utility Application which is nearly complete, but now I´m on a point were I really have to persist Data. Since XCode provides only Core Data Templates in an Navigation or Window Based App, is there an easy way to add Core Data to my Application? I´ve never worked with Core Data and just have to persist messages with 460 Characters and a contact Name tp it as a history of send Messages. Or should I start with a new Window Based Application incl. Core Data and try to build the

How to get UIMenuController work for a custom view?

落爺英雄遲暮 提交于 2019-11-27 11:09:04
I'm trying to get the following code work: UIMenuController * menu = [UIMenuController sharedMenuController]; [menu setTargetRect: CGRectMake(100, 100, 100, 100) inView: self.view]; [menu setMenuVisible: YES animated: YES]; The menu instance is ready but it doesn't show - the width is always zero. Or is there some sample code on this UIPasteboard/UIMenuController topic? krasnyk I was not able to get it working even when I read all of your answers. I'm presenting ready code that will work for everyone. Let's say we have a controller class named Controller. You can simply paste the following

Learning the basics of UIScrollView

ぃ、小莉子 提交于 2019-11-27 11:07:23
I've been having a very hard time finding good examples of UIScrollView. Even Apple's UIScrollView Suite I find a bit lacking. I'm looking for a tutorial or example set that shows me how to create something similar to the iPhone Safari tab scrolling, when you zoom out from one browser window and can flick to others. But I'm having a hard time just getting any old view showing within a scroll view. I have a view set up with an image in it, but when I add it to the scroll view, I only get a black rectangle, no matter what I put in the view I add. Any links or code snippets would be great! Ben

iphone - How do I add videos to iPad simulator?

久未见 提交于 2019-11-27 10:58:17
No, dropping the videos to ~/Library/Application Support/iPhone Simulator/3.2/Media/DCIM/100APPLE does not work totally, because the simulator can see the video on Photos.app, but when I try to pick a video using UIImagePickerController my application crashes. I think this may have some relation to the format the video has to have. I am using QuickTime to generate the video. I am using the settings "for iPhone"... so it is generating a M4V with 480x360 pixels H264. I have tried to create a MOV with the same characteristics and one with 640x480 but nothing works. I have also dropped a movie

Can font size of UILabel be changed with smooth animation on iPhone?

折月煮酒 提交于 2019-11-27 10:45:10
问题 I want a UILabel to swell slightly when selected like in some game menu screens. To get smooth resizing I presume I should put some change to the label's properties in an animation block. The obvious thing to try is to change the label.font.pointSize property but that's readonly. Scaling the label's .transform property with CGAffineTransformationMakeScale() makes the text blurry. Is there some other way to do this? 回答1: Set the font on the UILabel to be the size that you want when it is

How to download PDF and store it locally on iPhone?

心不动则不痛 提交于 2019-11-27 10:34:37
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 loadRequest:request]; webView.scalesPageToFit = YES; How am I able to achieve this? RVN I have found one

How to renew an iPhone development certificate?

和自甴很熟 提交于 2019-11-27 10:34:00
My development certificate has expired. What is the correct method of renewing it? Do you revoke the expired certificate & submit a new Certificate Signing Request? Do provisioning profiles have to be recreated? Are there any side-effects of doing this? If the certificate is expired, you can not revoke it. You need to re-create it through the developer program portal. Once you have your new certificate available, I am not sure if you need to create again the provisioning profiles associated to your previous certificate. I guess you must probably do this (unless the provisioning profiles just

How to change Xcode Project name

ε祈祈猫儿з 提交于 2019-11-27 10:18:36
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 .. For Xcode 4 or later: Open a project Select Project Navigator Highlight project name Single click on project name For Xcode 3: Open a project > Menu > Project > Rename ... There is no need to change the name of the project in order

Resulting lines of UILabel with UILineBreakModeWordWrap

随声附和 提交于 2019-11-27 09:48:16
问题 I have a UILabel whose size is calculated with sizeWithFont: method. The line break mode is set to UILineBreakModeWordWrap (same flag is used when calculating the size with sizeWithFont: )... Everything works great, label is properly sized and displays my text as required. Now I need to know the lines that are used to display the label (or the lines that are generated when sizeWithFont: is used). I could technically write my own implementation of line breaking based on spaces/caret returns,

Detecting a Lightweight Core Data Migration

一世执手 提交于 2019-11-27 09:41:49
问题 I'm using Core Data's automatic lightweight migration successfully. However, when a particular entity gets created during a migration, I'd like to populate it with some data. Of course I could check if the entity is empty every time the application starts, but this seems inefficient when Core Data has a migration framework. Is it possible to detect when a lightweight migration occurs (possibly using KVO or notifications), or does this require implementing standard migrations? I've tried using