iphone-sdk-3.0

iPhone UILabel text soft shadow

点点圈 提交于 2019-11-28 02:55:05
I know soft shadows are not supported by the UILabel out of the box, on the iPhone. So what would be the best way to implement my own one? EDIT: Obviously I will subclass the UILabel and draw in the -drawRect: My question is, how do I get the contents of the label as graphics and draw around them, blur them etc... EDIT 2: I returned to this question about a year later. In the meantime I've built a class that allows you to easily add soft shadow to a label and tweak it's radius etc and also to draw gradients on the text itself. You can find it on GitHub: https://github.com/doukasd/iOS

Connect iPhone App to PostgreSQL Using Libpq

本秂侑毒 提交于 2019-11-28 02:08:13
问题 I need to create an application for the iPhone that will connect to a PostgreSQL 8.4 database using libpq. The problem is I can't get a simple iPhone that links to libpq to compile. I am however able to get the equivalent application that is a regular Mac desktop app to compile and connect to PostgreSQL without any issues. I'm on Xcode 3.2 running on Snow Leopard. I'm building libpq for both arm and for x86_84. The arm build is for the real iPhone and the x86_64 is for the iPhone simulator to

UITableView does not respond to scrolling the first time it's loaded

一世执手 提交于 2019-11-28 01:48:08
问题 I have found that the first time a UITableView loads, it does not respond to scrolling touches -- if it does not have more rows than fit on the screen. If I close the view, then reopen the same object -- it will now respond to touches -- even though it contains the same number of rows. I am not doing anything more than responding to the UITableViewDataSource methods for the number of rows, and generating the rows themselves. I am reloading the table every time the view appears. Can anyone

Why is my app delegate's didFinishLaunchingWithOptions method all of sudden being called AFTER my RootViewController:viewDidLoad method?

主宰稳场 提交于 2019-11-28 01:08:21
问题 I've been playing with the iPad's SplitView template in Xcode. Here are two of the many important methods that are auto-generated for you by the Split View-based Application template... AppNameAppDelegate.m #pragma mark - #pragma mark Application lifecycle - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after app launch rootViewController.managedObjectContext = self.managedObjectContext; // Add

Showing IPhone keyboard in different languages based on user input

ⅰ亾dé卋堺 提交于 2019-11-28 00:27:16
问题 My question is related to the following question, and can be said almost same. Setting the iPhone keyboard language But here are my requirement. I am writing dictionary app for IPhone, which support multiple languages. So my requirement is to display the English keyboard when user has selected English language and show Dutch keyboard when user has selected Dutch and so on. So i was wondering if this is possible? I have a hunch that if i "internationalize" the nib, it will display the

How to Sort an NSMutableArray of Managed Objects through an object graph

风流意气都作罢 提交于 2019-11-27 23:37:00
问题 I'm new to Apple's iPhone 3.0 SDK support of Core Data and I'm relatively new to iPhone development. My question is on slightly more "complex" sorting than is covered in the docs. I suspect that I am making an incorrect, fundamental assumption. How can I sort a pre-fetched collection of managed objects by a property contained several layers deeper in the collection? Example: Farm has a 1 to many to Cowboy (Farm.cowboys) Cowboy has a 1 to 1 to Person (Cowboy.person) Person has lastName (Person

Reverse Geocode Current Location

我是研究僧i 提交于 2019-11-27 23:17:51
Is it possible to reverse Geocode your current location on SDK 3.x? I need to simply get the zip code of the current location. The only examples I've seen use CoreLocation which I dont think was introduced until SDK 4. lukewar You can use MKReverseGeocoder from 3.0 through 5.0. Since 5.0 MKReverseGeocoder is depreciated and usage of CLGeocoder is advised. You should use CLGeocoder if available. In order to be able to extract address information you would have to include Address Book framework. #import <AddressBookUI/AddressBookUI.h> #import <CoreLocation/CLGeocoder.h> #import <CoreLocation

How can I open the Settings app when the user presses a button?

浪尽此生 提交于 2019-11-27 23:06:56
From what I understand by using code like this: NSURL* appUrl = [NSURL URLWithString: @"URL"]; [[UIApplication sharedApplication] openURL:appUrl]; I can open Map, YouTube, Safari, Mail, iTunes and the App Store, when a user say presses a button. But I was wondering is it possible to open the Settings app with this method. Basically, the first time the user opens my app I want a UIAlertView to pop up to let the user know that they can change a specific setting if they want, and either they press OK or they press settings to take them to the settings app. I know that Apple do that in some

how to get the event that switch tab menu on iphone

独自空忆成欢 提交于 2019-11-27 22:44:01
I'm trying to figure out how to catch the event that controls the switch tabs on the UITabBarController . How could I accomplish this? If you are using storyboard, do this in didFinishLaunchingWithOptions UITabBarController *tabBar = (UITabBarController *)self.window.rootViewController; [tabBar setDelegate:self]; Also in AppDelegate, keep <UITabBarControllerDelegate> And then -(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { //Write your code here } Implement UITabBarControllerDelegate e.g. in your app delegate's

How can you reference child entity name in a predicate for a fetch request of the parent entity?

二次信任 提交于 2019-11-27 21:51:59
问题 I have the need to create a complex predicate for an abstract base object. I want to have separate predicate queries for different inheriting entities and key off the sub-entity type, the example below is what I would like to do, however, I have not been able to find a way to reference the entity name or type in the predicate. NSFetchRequest *request = [[NSFetchRequest alloc] init]; request.entity = [NSEntityDescription entityForName:@"MyCommonObjectBase" inManagedObjectContext:myContext];