cocoa-touch

Universal iOS app crashing on iPhone/iTouch 3.1.3 due to UIPopoverController

喜欢而已 提交于 2020-01-15 05:51:08
问题 I just updated my app so that it's a universal app. In doing so I added support for UIPopoverController in a certain place. Now the app seems to be crashing on 3.1.3 iPhone/iTouch devices: OS Version: iPhone OS 3.1.3 (7E18) Report Version: 104 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x00000001, 0xe7ffdefe Crashed Thread: 0 Dyld Error Message: Symbol not found: _OBJC_CLASS_$_UIPopoverController What I don't get is that I'm only trying to call UIPopoverController if the

How to detect touch in triangle area

人走茶凉 提交于 2020-01-15 03:11:30
问题 For my application, i need to divide diagonally the screen of my iphone in 4 parts and detect which of the part was touched. I am very confused because my areas are triangles and not squares and I can't find a solution to detect which of the triangle was touched... I get the touched Point with method touchesBegan, and there I'm stuck... :( How to define triangle shapes and test if it was touched? with View? layer? It could be really cool if someone could help me. 回答1: This website show some

XCode: Two targets, two main files?

℡╲_俬逩灬. 提交于 2020-01-14 15:04:52
问题 I'm working up a game in XCode, and I want to add a helper application that uses the main application's various classes to build the main application's data files. Specifically: The main application is a card game. I want a helper app that uses the classes such as card.m while it creates the deck.xml files for the deck of custom cards the game uses. My intuition is that the natural way to do this is to add a second compile target to the application, "Card Adder", to build this xml file.

How to add a combobox and a button to the infoWindow on Google map?

别来无恙 提交于 2020-01-14 15:03:39
问题 Currently, I'm developing an application, in which I have to show an infoWindow on click event on map itself. My question is I want to show a button as well as a combobox on this infoWindow. How can I do this? 回答1: You need to add a custom UIView to your MKMapView and supress the default MKAnnotation callout view. Your custom UIView can include the controls you want in the callout. You might find the following useful: customize callout bubble for annotationview? A development blog with some

how can I limit the map area to only one country in iOS?

半腔热情 提交于 2020-01-14 14:39:07
问题 I am making an app for iOS using mapkit. I want to limit the boundaries of the map only to a specific region/country. Is there a way to do this? 回答1: There's no way to tell the map not to scroll out of a certain area. The only way I could think to do it would be to stop the user from scrolling when you hit one of your fences. The example below is written without testing or compiling at all so you may need to tweek it yourself but hopefully it'll get you started.. ViewController.h

New PayPal iOS SDK (beta) - Can't connect to sandbox

梦想的初衷 提交于 2020-01-14 14:39:07
问题 I've integrated the new PayPal iOS SDK into my app. Reference can be found here. The new SDK is really easy to set up and it allows you to work in 3 different environments 1.) PayPalEnvrionmentNoNetwork 2.) PayPalEnvironmentSandBox and 3) No environment meaning to go onto their live servers. Everything works for the NoNetwork Environment, obviously because it uses mock dummy data, not having to access any servers. When I try to switch to the SandBox environment, PayPal can't connect to the

Open specific tab bar when receive push notification

♀尐吖头ヾ 提交于 2020-01-14 14:31:34
问题 How can i open specific tab bar when receive push notification? i already put [self.tabBarController setSelectedIndex:2]; on viewDidAppear and what happen is in data logging, it showing that it passing through tabBar 2 viewController but it not open/showing that page and remain at the firstView controller/ first tabBar. and then after i terminate the app and open back, automatically/ suddenly it open the tabBar 2 viewController. can anyone give any idea or sample code to solve this? this is

Open specific tab bar when receive push notification

被刻印的时光 ゝ 提交于 2020-01-14 14:31:07
问题 How can i open specific tab bar when receive push notification? i already put [self.tabBarController setSelectedIndex:2]; on viewDidAppear and what happen is in data logging, it showing that it passing through tabBar 2 viewController but it not open/showing that page and remain at the firstView controller/ first tabBar. and then after i terminate the app and open back, automatically/ suddenly it open the tabBar 2 viewController. can anyone give any idea or sample code to solve this? this is

Assigning NSUInteger to BOOL conceptual understanding

跟風遠走 提交于 2020-01-14 12:59:34
问题 I am trying to look for a good answer to the concept of BOOL. As I understand, a zero is a false value, and non-zero is a true value. Thinking this I assigned string length into a BOOL variable. Now, this works fine for iOS > 6. On iOS 6 I see strange results. For string with odd length, isEnabled is turing True but for strings with even length, isEnabled is turing False. BOOL isEnabled = myString.length; Please help me understand this. Of course, now I've been assigning expressions to BOOL

How to save SKProduct object locally?

主宰稳场 提交于 2020-01-14 12:48:51
问题 I have tried to save a SKProduct object with archiving it with the class NSKeyedArchiver but it generates an error as -[SKProduct encodeWithCoder:]: unrecognized selector sent to instance . + (void)saveProduct:(SKProduct *)product { NSData *data = [NSKeyedArchiver archivedDataWithRootObject:product]; [[NSUserDefaults standardUserDefaults] setValue:data forKey:PRODUCT]; [[NSUserDefaults standardUserDefaults] synchronize]; } Is there a way to save an instance of SKProduct or not? 回答1: Your