iphone-4

colorWithPatternImage with iPhone 4 Retina Display (image@2x.png)

Deadly 提交于 2019-12-10 02:54:31
问题 Thanks to SO's search function blowing up whenever I enter "@2x", it's difficult to tell whether this has already been asked... I've been using colorWithPatternImage: to build tiled background images for my various views. However, these predictably look like trash when viewed on the new iPhone 4 display. So I've built @2x versions of my tile.png files, yet colorWithPatternImage: evidently can't properly handle UIImages with double the scale. Has anyone effectively developed a workaround for

How do I test the equality of two CLLocations

徘徊边缘 提交于 2019-12-08 16:47:19
问题 I'm having a problem with isEqual: The code: if (currentAnchor isEqual:currentBusiness.getCllLocation)) { do a; } else { do b; } currentanchor and currentbusiness.getCllocation are locations But if they are the same, why is function b called? Is something wrong with my code? 回答1: I assume both of these objects are of type CLLocation , based on the name of getClLocation . CLLocation doesn't have any specification on what its isEqual: method does, so it's likely just inheriting the

iOS5 Core Plot fit plot to visible area

徘徊边缘 提交于 2019-12-08 10:28:45
问题 I got a plot for which I defined the Y range as -2000 to 2000 plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromInt(1) length:CPTDecimalFromInt(600)]; plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromInt(-2000) length:CPTDecimalFromInt(2000)]; The plot is fitted to the graph along the X axis, causing the majority of the Y axis to be cut off. How can I ask the core plot to autoscale the Y axis to make the maximum value in a series just touch the top of

Xcode 4.2 with iOS 5.0 not detecting iPhone iOS 5.1.1

别来无恙 提交于 2019-12-08 09:45:15
问题 I changed a while ago from Xcode 3 to Xcode 4.2 for Snow Leopard. Everything was fine, I developed apps for iPhone and all was going smoothly until today... I got alert: The version of iOS on “iPhone Prophone” does not match any of the versions of iOS supported for development with this installation of the iOS SDK. Please restore the device to a version of the OS listed below, or update to the latest version of the iOS SDK; which is available here. Which is strange, because yesterday I was

App rejected for crash on launch, but cannot replicate in either simulator or device, and device log is cryptic

半世苍凉 提交于 2019-12-08 09:18:03
问题 I recently had an app rejected for crashing on launch on an iPhone 5 in iOS 5.0, and the good folks at Apple attached a crash report. However, I can't replicate this crash on either my device (also an iPhone 4 running iOS 5) or in the simulator for iOS 5. And, as you can see from the copy below, the report is cryptic. The crash is taking place in thread 5, which helpfully includes ??? where information should be. First question - is this crash report symbolicated wrong? I kept the dSYM and

UIImageview programmilly manage for iphone5 and iphone4

Deadly 提交于 2019-12-07 14:32:25
问题 I have an Issue about UIImageView Manage by XIB file for iphone5 screen Height and Iphone4 Screen Height. I Try to Manage code for UIImageView like this ~ CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height; if ([UIScreen mainScreen].scale == 2.f && screenHeight == 568.0f) { backgroundImage.autoresizingMask=UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; frameView.autoresizingMask=UIViewAutoresizingFlexibleHeight; backgroundImage.image = [UIImage imageNamed:@"bg

iPhone 4 ignoring viewport meta tag

扶醉桌前 提交于 2019-12-06 13:30:54
问题 I have just added the following HTML to the <head> section of my iPhone web app: <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;"/> This (supposedly) limits the zoom of the page so the user can't zoom in. On iOS versions prior to 4.0, this tag is respected - but iOS versions 4.0+ completely ignore it, and lets you zoom in all you want. Furthermore, if you rotate, iPhone 4 will weirdly zoom in automatically. So what I'm asking is, How

How to make an iphone and iphone4-retina compatible app (done in cocos2d) easily adapted to ipad?

痞子三分冷 提交于 2019-12-06 09:58:42
My question is simple: 1. I made an iphone app all done in cocos2d. 2. I adapted it to iphone4-retina, with all PNG files have their -hd copy. Run in iPhone, the app displayed correctly (320x480). Run in iPhone4-retina, the app also displayed correctly (640x960). But run in iPad, if the app is set to iPhone only, it run correctly, but only as iPhone resolution (320x480). If the app is set to iPhone/iPad, of cause it will display wrong. I'm sure there should be an option that force a retina-compitable iPhone app also run as retina on iPad (apple guys cannot be silly enough to miss it), but I

iPhone 4 web-app browser width: 960 or 981?

空扰寡人 提交于 2019-12-06 08:39:28
问题 <html> <body REMonload="document.location.assign('index2.php?w=' + window.innerWidth + '&h=' + window.innerHeight);"> <script language="javascript"> document.write('w=' + window.innerWidth + '&h=' + window.innerHeight); </script> </body> </html> Output: w=981&h=425 Why? Wikipedia says, w should be 960. Regards, UPDATE I've found out, the problem was related to viewport meta tag. The following code does what I want to see: <html style="width:100%; height:100%;"> <head> <meta name="viewport"

UIImageview programmilly manage for iphone5 and iphone4

て烟熏妆下的殇ゞ 提交于 2019-12-05 21:25:12
I have an Issue about UIImageView Manage by XIB file for iphone5 screen Height and Iphone4 Screen Height. I Try to Manage code for UIImageView like this ~ CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height; if ([UIScreen mainScreen].scale == 2.f && screenHeight == 568.0f) { backgroundImage.autoresizingMask=UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; frameView.autoresizingMask=UIViewAutoresizingFlexibleHeight; backgroundImage.image = [UIImage imageNamed:@"bg-568h@2x.png"]; //frameView.frame=CGRectMake(16, 0, 288, 527); frameView.image = [UIImage imageNamed:@