uikit

Are there any tools or good techniques to find out where the performance bottlenecks are in an iPhone application?

巧了我就是萌 提交于 2019-12-25 18:19:55
问题 I have an app that's half way done. The performance is not really good, and I wonder where the bottlenecks are. Although I can go ahead and start commenting out suspected lines of code, I wonder if there are any tools that would tell me which method cool took how long and what happened next. The stack trace isn't really that helpful. I had a weird idea to convert the stack trace into an GraphViz graph, to see visually the whole picture. I know some guys at IBM did something similar that

Iterate over individual pixels of a UIImage with height information

守給你的承諾、 提交于 2019-12-25 16:44:10
问题 I'm trying to automatically crop an image that has extraneous white color above and below it. I'm trying to iterate over the pixels of the image to find the first non-white pixel to set that as the appropriate height to crop from the top, and then using the last non-white pixel as the appropriate height to crop from the bottom. I've attempted using CGBitmapContextGetData to generate the individual pixels but as far as I can tell this only preserves the RGB color of the pictures so the

Ember.js and UIKIT

眉间皱痕 提交于 2019-12-25 11:53:12
问题 I try to add UIKIT to my Ember.js project how to do it? 1: bower install --save uikit All work fine on bower.json i don't know what to put on ember-cli-build.js e.g : app.import('bower_components/uikit/css/uikit.css'); How to do about js files? Thanks 回答1: you import js files same way as css files, if js files are in bower_components/uikit/js/uikit.js you do app.import('bower_components/uikit/js/uikit.js'); 来源: https://stackoverflow.com/questions/34465374/ember-js-and-uikit

How to design code architecture when overlapping objects exist?

依然范特西╮ 提交于 2019-12-25 11:47:12
问题 I have 1 main Master screen (MVC) and 4 other screens that share ~80% of graphic objects. They differ in some label texts, a button with action and some other 20% graphics. Thinking in terms of clean object oriented code architecture, I have started to implement those screens as separate UIViewControllers. But I didn't like having pointers to those 4 MVCs and a duplication of some methods, so I rewrited the code into one UIViewController. Most of graphic objects are UIImageViews that I put on

How can I animate a UITableViewCell's colors?

情到浓时终转凉″ 提交于 2019-12-25 11:33:36
问题 I want to allow the user to switch between a few color palettes in the application, IE how XCode and other text editors allow you to switch between light and dark backgrounds. I'm able to do all this simply enough, but now I'm trying to wrap the change in a simple animation block so the color changes fade in. Everything works great with the exception of my table view cells. The colors change, but they don't animate. [UIView animateWithDuration:0.5 animations:^{ self.tableView.backgroundColor

subclassing initWithFileURL of an UIDocument

风格不统一 提交于 2019-12-25 09:08:54
问题 I'm trying to overwrite the initWithFileURL of an UIDocument as I need to call some custom methods once an UIDocument is initialised. I thought this may be a good idea: -(id)initWithFileURL:(NSURL *)url { self = [super initWithFileURL:url]; // do some custom stuff return self; } Is there anything else I need to do if I overwrite this? I have the feeling that I need to check for NIL or something. Where do you usually look if you need to overwrite a method with something custom? I was only able

UITableViewController with different Cell sizes and Cell content in Storyboard

橙三吉。 提交于 2019-12-25 08:20:10
问题 I want to make a UITableViewController with different Cell sizes and different content of the cells. For example: Is there a way to use AutoLayout within the Storyboard to define the different sizes of the TableViewCells ? What would be the best way to define the content (a UIView with content on it) of the TableViewCells ? 回答1: To change the cells of the UITableView, you have 2 options: Option A (best) is to use Autosizing TableView Cells with Autolayout Constraints. To use option A, you

error when trying to undo Context

非 Y 不嫁゛ 提交于 2019-12-25 07:59:14
问题 i try to undo myContext from save state then after i draw the line i call undo method to restore my context to previous but it report error <Error>: CGContextRestoreGState: invalid context code - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint currentPoint = [touch locationInView:self.view]; UIGraphicsBeginImageContext(self.view.frame.size); [drawImage.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame

Not able to change the frame of UIButton Programmatically.?

人盡茶涼 提交于 2019-12-25 05:33:35
问题 I am trying to add more textfields in my View, Textfield is getting added but the button is not changing the frame . And its gone inside the uitextfield which i have added . Please let me know where i am getting wrong . Thanks I am sharing the code snippet here itself. -(IBAction)addMore:(id)sender { UITextField *moreText = [[UITextField alloc] initWithFrame:CGRectMake(20, textfieldy, 280, 44)]; CGRect buttonFrame = self.addmore.frame; buttonFrame.origin.y += 10; self.addmore.frame =

In iOS, can a UIButton be added by alloc and initWithFrame?

柔情痞子 提交于 2019-12-25 05:15:27
问题 A button can be added by: UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; myButton.frame = CGRectMake(100, 100, 160, 50); [myButton setTitle:@"click me" forState:UIControlStateNormal]; [self.view addSubview:myButton]; but can we go with the initWithFrame method: UIButton *myButton2 = [[UIButton alloc] initWithFrame:CGRectMake(100, 300, 160, 50)]; //myButton2.buttonType = UIButtonTypeRoundedRect; myButton2.titleLabel.text = @"click me"; [self.view addSubview:myButton2];