ios6

Modern technique of adding gradient to UIView

谁都会走 提交于 2019-12-06 08:06:47
问题 I know of several ways of adding background gradients to UIView. I was wondering what is the most efficient and scalable way of doing so, and why? Here are the techniques I've used: Create subview of UIView and overwrite the drawRect, where I draw the gradient in current context. a. When using the above gradient create it with the bounds of view I want to decorate and insert this background gradient as first subview, i.e. – insertSubview:atIndex: b. After I get the background gradient view

How to launch an APP in background in iOS 6.x silently

≯℡__Kan透↙ 提交于 2019-12-06 07:56:51
问题 We want to launch an APP silently in iPhone without bring this APP to the Foreground. In iOS 5.x we achieve this goal by this code: [(SBApplication*)app setDisplaySetting:0x4 flag:NO]; [(SBDisplayStack*)displayStack pushDisplay:app]; [(SBDisplayStack*)displayStack popDisplay:app]; But, in iOS 6.x there is not SBDisplayStack any more. I did some search but not found any answers. Someone says that SBWorkSpace replaces the SBDisplayStack in iOS 6.x. We use SBAppToAppWorkspaceTransaction to

Parse.com and Facebook login, runs infinite loop

浪子不回头ぞ 提交于 2019-12-06 07:53:31
I updated both Parse and Facebook iOS SDKs to the latest versions, and when I try to login using Facebook my app crashes, and from the debugger I can see that it is calling 3-4 methods in an endless loop. My login code looks like this: - (void)openSession { UIViewController *topViewController = self.window.rootViewController; NSArray *permissions = [NSArray arrayWithObjects:@"user_likes", @"friends_likes", nil]; // Login PFUser using Facebook [PFFacebookUtils logInWithPermissions:permissions block:^(PFUser *user, NSError *error) { if (!user) { if (!error) { NSLog(@"Uh oh. The user cancelled

How to get the XML parsed images into array and use the array in all view controllers using iphone sdk

感情迁移 提交于 2019-12-06 07:44:13
I have an XML file in URL where i can parse the data and get the images from the XML file. But i don't know how to use the images in other view controllers. I got an idea to store the images in array, but how can i use the array of images in other view controllers. Is it possible to store the XML parsed images in array.Am i parsing the XML correctly? Kindly suggest me an idea. My XML Parser //egsBase.h #import <Foundation/Foundation.h> @interface egsBase : NSObject{ IBOutlet UIImage *img; } @property(nonatomic,retain) IBOutlet UIImage *img; @end //egsBase.m #import "egsBase.h" @implementation

Routing Data for MKMapKit in iOS6

核能气质少年 提交于 2019-12-06 07:43:26
问题 I have done routing in iOS apps before, but with iOS6 we are now displaying Apple maps - which causes a problem because we are using Google routing data and if we use Google data, we are supposed to be displaying it on a Google map. I have been searching but as far as I can tell, Apple does not provide any routing data. The closest thing to an answer so far seems to be when Apple says Apps that consume direction information do so by sending an appropriate request to the Maps app, which then

requestAccessToEntity iOS6- Backwards compatibility - EKEventStore

泪湿孤枕 提交于 2019-12-06 07:39:06
问题 following iOS6 eventKit and the new privacy settings I am using the following code - which works perfectly fine on iOS6 devices. Still, I would like the same code to work also for devices with iOS 5.x and I wish not to write a the "same code" twice - Seems wrong. Can anyone assist in an elegant solution ? EKEventStore *eventStore = [[EKEventStore alloc] init]; [eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { // some code }]; 回答1: I'm using

Playing youtube using <iframe> fails on iPhone, but still works for iPad under iOS 6 (both work fine on iOS 5)

对着背影说爱祢 提交于 2019-12-06 07:34:09
问题 I use the following HTML template with an to hand to a UIWebView. I understand that this is the supported way to play youtube videos. <html> <body> <!-- 1. The <iframe> (and video player) will replace this <div> tag. --> <div id="player"></div> <script> // 2. This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = "http://www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag

ZxingWidget archive error on ios6.0

纵饮孤独 提交于 2019-12-06 07:31:09
问题 I try to archive the ZxingWedget Demo,scanTest. compile is ok. it can run on the simulator. but it can not archive completely on ios6.0. this is the error: Stripping /Users/ganguo/Library/Developer/Xcode/DerivedData/ScanTest-gadjcaxemklyqpcxsvmiorzakfhu/Build/Intermediates/ArchiveIntermediates/ScanTest/IntermediateBuildFilesPath/ZXingWidget.build/Release-iphoneos/ZXingWidget.build/Objects-normal/armv7/libZXingWidget.a cd /Users/ganguo/objc/lib/zxing/iphone/ZXingWidget setenv PATH "

Unable to post image into facebook using SLComposeViewController?

时光怂恿深爱的人放手 提交于 2019-12-06 07:21:37
问题 I would like to post image into facebook and twitter. I am fine with twitter but not with facebook using SLComposeViewController class. With out add image i am able to post text and url into facebook. The problem is when i use add image i was unable to post this image and also text, url. SLComposeViewController shows image, text and url when i send. I have correct appId and i did not get any errors. But the problem is still there. I don't where the problem is. Please help me. - (void

Hiding Address Bar in Mobile Safari With Reader Button Visible

故事扮演 提交于 2019-12-06 06:39:26
问题 Ok, so I'm using the suggested window-scrollTo method and it's working just swimmingly everywhere except for one little sticking point. When Safari decides to show the "Reader" button figuring I might want to save my page for later reading, it keeps the address bar up for a full 5 seconds before finally hiding it like I asked. Kind of an eternity in UX time. Is this an iOS 6 thing or did it also do this in iOS 5? (I don't have a 5 device to test it on at the moment.) Also, is there any way to