iphone-sdk-3.0

Change title of MFMailComposeViewController

半世苍凉 提交于 2019-11-28 23:28:34
I'm using MFMailComposeViewController for in-app email in my app, but I'm not able to change the title. As default it's showing the subject in the title, but I would like to set the title to be something else. How can I do that? I've tried: controller.title = @"Feedback"; but it didn't work. Here's my code: - (IBAction)email { NSArray *array = [[NSArray alloc] initWithObjects:@"myemail@gmail.com", nil]; MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; [[controller navigationBar] setTintColor:[UIColor colorWithRed:0.36 green:0.09 blue:0.39 alpha:1.00]];

UITabBarController, MoreNavigationController and the Holy Grail of Device Rotation

女生的网名这么多〃 提交于 2019-11-28 23:25:35
问题 UPDATE: See my answer to this question first. This appears to be a bug. A minimal test case has been created and a report has been filed with Apple. (Fixed as of iPhone OS 3.1.) Here's a puzzler from the "I'm so close!" department. I have a Tab Bar-based iPhone app. Each tab features a UINavigationController with the usual suspects (nav bar, table view ... which in turn can lead to another VC, etc.). Now, one of those lower-level VCs is to be used in portait and landscape modes. But there's a

SKPayementQueue: restoring transactions finishes without calling 'updatedTransactions' in release config but not debug config

99封情书 提交于 2019-11-28 23:14:07
问题 I'm debugging restoring transactions and in my debug configuration everything works normally: IE I call: [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; sometime later the queueCalls: - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions and sometime after that it calls: - (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue { and everyone is happy. BUT in my release configuration, I never see the call to

MonoTouch instability continues: managed memory allocator crashes

 ̄綄美尐妖づ 提交于 2019-11-28 20:53:35
Long story short: I can allocate tons of unmanaged memory, but trying to allocate the same amount (or far less) in managed memory crashes MonoTouch in GC_remap (callstack below). Details: I'll talk about one example of the behavior I described above. My app allocates a 2.5MB chunk of managed memory (using new byte[]) occasionally, and it often dies on my iPhone4 with the callstack pasted below (i.e. mprotect error during the allocation). I don't keep a reference to these 2.5MB blocks for longer than a single function call. The MonoTouch guys say that 'mprotect errno 12' means you've exhausted

How to place UIBarButtonItem on the right side of a UIToolbar?

白昼怎懂夜的黑 提交于 2019-11-28 20:13:22
I have designed a view with a toolbar that appears modally in Interface Builder. I have a UIBarButtonItem that is on the left hand side, which I would like to appear on the right hand side of the toolbar. How can I do this in IB, or via code? Here's how to do it in code if anyone comes across this post: UIBarButtonItem *leftButton = [[[UIBarButtonItem alloc] initWithTitle:@"Item" style:UIBarButtonItemStyleBordered target:self action:@selector(btnItem1Pressed:)] autorelease]; UIBarButtonItem *flex = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target

try & catch in iPhone?

那年仲夏 提交于 2019-11-28 19:11:54
The try{}catch construct is common to C++, Java & related languages. In the iOS SDK is there and any functionality like this? @try { // Try something } @catch (NSException * e) { NSLog(@"Exception: %@", e); } @finally { // Added to show finally works as well } 来源: https://stackoverflow.com/questions/5704038/try-catch-in-iphone

How to Add Core Data to an existing Utility Application

匆匆过客 提交于 2019-11-28 18:28:04
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 Utility / Flipside Part by hand? Can someone suggest me the best practice for my situation? You'll need

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

南楼画角 提交于 2019-11-28 17:48:05
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? Set the font on the UILabel to be the size that you want when it is enlarged. Then scale it down. When you want the label to swell, scale it back up to it's original size.

Resulting lines of UILabel with UILineBreakModeWordWrap

让人想犯罪 __ 提交于 2019-11-28 16:34:50
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, but then it's not going to be guaranteed the same way as Apple's implementation and hence the resulting

Detecting a Lightweight Core Data Migration

不想你离开。 提交于 2019-11-28 16:25:16
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 the NSPersistentStoreCoordinatorStoresDidChangeNotification , but it doesn't fire when migrations