cocoa-touch

Thread 1: EXC_BREAKPOINT (code=EXC_i386_BPT, subcode=0x0) error

霸气de小男生 提交于 2020-01-12 14:21:14
问题 I have an iPad app I am making, but it crashes on startup even though there are no errors or warnings, the output doesn't output anything besides "(lldb)", and it marks a pointer. This is the image of the post build crash. And here is the code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { /* UIImage *myImage = [UIImage imageNamed:@"de_dust2.png"]; myImageView = [[UIImageView alloc] initWithImage:myImage]; myScrollView

Thread 1: EXC_BREAKPOINT (code=EXC_i386_BPT, subcode=0x0) error

一世执手 提交于 2020-01-12 14:20:13
问题 I have an iPad app I am making, but it crashes on startup even though there are no errors or warnings, the output doesn't output anything besides "(lldb)", and it marks a pointer. This is the image of the post build crash. And here is the code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { /* UIImage *myImage = [UIImage imageNamed:@"de_dust2.png"]; myImageView = [[UIImageView alloc] initWithImage:myImage]; myScrollView

Thread 1: EXC_BREAKPOINT (code=EXC_i386_BPT, subcode=0x0) error

情到浓时终转凉″ 提交于 2020-01-12 14:20:08
问题 I have an iPad app I am making, but it crashes on startup even though there are no errors or warnings, the output doesn't output anything besides "(lldb)", and it marks a pointer. This is the image of the post build crash. And here is the code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { /* UIImage *myImage = [UIImage imageNamed:@"de_dust2.png"]; myImageView = [[UIImageView alloc] initWithImage:myImage]; myScrollView

draw a line in UIImageView problem

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-12 11:11:56
问题 In my application i can draw a line in a UIImageView by the code below,and i want redraw the line even longer when i call the function,however,the output come out is not as expected,it will just draw a new line and remove the old one,the length is remain the same jus the y position different,i dont know which line of my code is wrong or i havent understand the CGContext class in correct way,please help i have scratch my head all the days and cannot find out the problem - (void) drawLine {

draw a line in UIImageView problem

谁说我不能喝 提交于 2020-01-12 11:11:10
问题 In my application i can draw a line in a UIImageView by the code below,and i want redraw the line even longer when i call the function,however,the output come out is not as expected,it will just draw a new line and remove the old one,the length is remain the same jus the y position different,i dont know which line of my code is wrong or i havent understand the CGContext class in correct way,please help i have scratch my head all the days and cannot find out the problem - (void) drawLine {

Is an NSMutableString in this case more efficient than NSString?

两盒软妹~` 提交于 2020-01-12 10:39:32
问题 If I declare a pointer variable in this fashion: NSString *foo; And then somewhere later in my code do something such as: foo = @"bar"; Is that ultimately taking my NSString, creating a new copy in memory with an additional string, then deleting my initial string? Would foo be better off as an NSMutableString? 回答1: No, foo is variable holding a pointer to an NSString . The assignment foo = @"bar" sets the value stored by the pointer foo to the address of the NSString @"bar" . There is no copy

UIKit: UIScrollView automatically scrolling when a subview increases its width past the edge of the screen

大城市里の小女人 提交于 2020-01-12 06:58:08
问题 In the context of the iPhone: I have a UIScrollView containing a UIImage . When the user taps the screen inside the UIImage , a UITextField is added where the user touched. The user can edit this UITextField , and the text field will automatically resize itself based on whether text was added or deleted. When the a UITextField being edited increases its width, the scrollview automatically scrolls to show the increased width. The problem comes in because the automatic scrolling of the

Clean solution to know which MKAnnotation has been tapped?

对着背影说爱祢 提交于 2020-01-12 05:28:26
问题 Ok, so you typically have some object X you want to be annotated inside a MKMapView. You do this way: DDAnnotation *annotation = [[DDAnnotation alloc] initWithCoordinate: poi.geoLocation.coordinate title: @"My Annotation"]; [_mapView addAnnotation: annotation]; Then you create the annotation view inside - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation; And when some callout gets tapped, you handle the event inside: - (void)mapView:(MKMapView *

How to display text using Quartz on the iPhone?

可紊 提交于 2020-01-12 05:21:12
问题 I've been trying to display text using a Quartz context, but no matter what I've tried I simply haven't had luck getting the text to display (I'm able to display all sorts of other Quartz objects though). Anybody knows what I might be doing wrong? example: -(void)drawRect:(CGRect)rect { // Drawing code CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSelectFont(context, "Arial", 24, kCGEncodingFontSpecific); CGContextSetTextPosition(context,80,80); CGContextShowText(context,

CGContext rotation

北城余情 提交于 2020-01-12 03:56:09
问题 I have a 100x100 pixel image that I want to draw at various angles rotated around the center of the image. The following code works, but rotates around the original origo of the coordinate system (upper left hand corner) and not the translated location. Thus the image is not rotated around itself but around the upper left corner of the screen. The following code was run in a custom view in a blank application with nothing else but this. - (void)drawRect:(CGRect)rect { CGContextRef context =