uikit

UIButton oversensitive

主宰稳场 提交于 2019-12-22 10:33:22
问题 I have a UIButton defined within a tableviewCellWithReuseIdentifier. The button works but it's very touchy. If I just tap the button it works. Pressing it any long fails to trigger the action, even though it does flash showing that it knows it was pressed. Why is this happening? More importantly, how can I fix it. Here is the code for the UIButton within the cell. CGRect rect = CGRectMake(190.0, 2.0, 40.0, ROW_HEIGHT); UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];

UIScrollView unwanted scrolling after addSubview or changing frame

♀尐吖头ヾ 提交于 2019-12-22 10:11:17
问题 I have a UIScrollView filled with subviews, all is well when creating it and initially filling it. But when I add a new subview that is positionned outside of the visible screen portion, or when I just resize an existing subview that is also outside of the visible screen portion, there is a subsequent 0.3s-long scroll animation (I can see it happening from my delegate) that seems to match the newly added/resized element. Attempts: pagingEnabled is always NO. Setting scrollEnabled to NO during

UIDocumentInteractionController disable open in certain apps

[亡魂溺海] 提交于 2019-12-22 08:17:09
问题 I'm currently using a UIDocumentInteractionController for open in functionality. When it opens it shows a list of all apps on the device that can handle that file type. Is there a way to disable my app sending a document to specific apps, even if they support that file type? For example - if I have a PDF file open in my app and iBooks is on the iPad, if I tap the iBooks icon in the UIDocumentInteractionController, I don't want it to send it to the app. Ideally - I see this as building a

How to remove the “fuzzy” drop shadow in the UIPopoverController

烈酒焚心 提交于 2019-12-22 07:25:30
问题 I don't want the drop shadow when the UIPopoverController's view appears. Is there a way to remove this drop shadow look? 回答1: Not straight forward, but since iOS 5, you can make your own custom popover background using UIPopoverBackgroundView. See the answer for this question: Using UIPopoverBackgroundView class. It's pointing to a good tuto. Then, in the initWithFrame of your UIPopoverBackgroundView implementation, you can use a clearColor for the drop shadow. Using offset and radius did

iOS Core Graphics How to erase a drawing

十年热恋 提交于 2019-12-22 06:30:06
问题 I am following this tutorial for my doodle application. http://www.raywenderlich.com/18840/how-to-make-a-simple-drawing-app-with-uikit his erase function is using white color drawing. But I am using image background and when I erase, I really need to erase. I have tried CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeClear); But it's not working. Here is my code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { _mouseSwiped = NO; UITouch *touch = [touches

UIGraphicsBeginPDFPage() randomly crashes on 64bit devices (CGPDFSecurityManagerCreateDecryptor ())

故事扮演 提交于 2019-12-22 06:02:44
问题 I'm struggling with a pdf export method that's was running just fine until I ported the app to the arm64 achitecture. Bacisally, the method opens an existing PDF, it creates a new pdf file, and draws the content of the first pdf into the newly created one before adding more content pages. When the method tries to create a new pdf page to the document (after the first pdf was integrated to the new pdf) the app crashes with a EXC_BAD_ACCESS warning on UIGraphicsBeginPDFPage(); call . It only

Moving an image along a series of CGPoints

狂风中的少年 提交于 2019-12-22 05:54:54
问题 I have path stored in an array of CGPoints which I'd like to move an image along. Here's the general code I have so far: -(void)movePic:(id)sender{ for(int i = 0; i < self.array.count; i++){ CGPoint location = [[self.array objectAtIndex:i] CGPointValue]; [UIView animateWithDuration:0.1 animations:^{ self.imageView.center = location; } completion:^(BOOL finished){ }]; } } The problem is the for loop runs extremely fast, so you only see the animation on the last points. I'm unsure of how to

Issue with Modal View Controllers and definesPresentationContext

我是研究僧i 提交于 2019-12-22 05:49:13
问题 I've created a custom container view controller using the new UIViewController container view controller methods in iOS 5. Trouble is, even though my container controller's child UIViewController has definesPresentationContext = YES, when it creates and presents another modal view controller, UIKit sets the container (rather than the child) as the presenting controller. For example, in MyChildViewController.m: - (void)showMailComposeView:(id)sender { __block MFMailComposeViewController *vc =

Iphone Web Thread _WebThreadLockFromAnyThread

送分小仙女□ 提交于 2019-12-22 04:43:34
问题 Perhaps one Iphone Guru can enlighten me... I've been going line-by-line and eliminating any threads calls / NSInvocation's that use the UIKit, as a matter of fact, I have made 100% sure that NO UIKit crap gets called from any-where else except the MainThread I.E... if([NSThread isMainThread]) { blah.... Call UIKit Crap here! and blah.... } So far so good, but then after I created a thread to do a http POST (using LibCurl) I started getting this: "void _WebThreadLockFromAnyThread(bool),

Easy way to print current stack trace of an app?

扶醉桌前 提交于 2019-12-22 04:19:22
问题 Xcode / objective c does not really print a useful stack trace. My app crashes somewhere, and the damn thing gives me only numbers like 45353453, 34524323, 6745345353, 457634524234. Not useful at all. So I want to make a NSLog(); on the beginning of EVERY method I have in my entire app. But maybe there's a simpler way to just find out the real stack trace, humanly readable? Not only on app launch or crash, but all the time, on every activity that happens? Would help debugging a lot. 回答1: