xcode6

Unable to get the email id of the User when Log-in with Facebook SDK in iOS

丶灬走出姿态 提交于 2020-01-03 15:31:23
问题 I am getting [null] value when I am fetching the user's email-id using below code. Also, I already set the permission to access the email like this. { self.fbLoginButton.readPermissions = @[@"public_profile", @"email", @"user_friends"]; } Also Fetching the email details in delegate. - (void)loginButton:(FBSDKLoginButton *)loginButton didCompleteWithResult: (FBSDKLoginManagerLoginResult *)result error: (NSError *)error { if ([FBSDKAccessToken currentAccessToken]) { [[[FBSDKGraphRequest alloc]

TableView Cell Separator Line Not Extending Across the Entire Cell

北城以北 提交于 2020-01-03 11:47:07
问题 I am working on a new project and have used a storyboard for the UI. All of my tableViews have an issue with the line separator. The picture below shows two lines. The first is a blue one which was set in the attributes inspector. The second one is black and was added with an imageView that I placed in the cell. The line does extend to the right side of the cell but not the left. Any ideas? 回答1: first set table view 1.set separatorInset of tableview instance to UIEdgeInsetsMake(0, 0, 0, 0)

in iOS 8 UITableView heightForHeaderInSection is not optional

会有一股神秘感。 提交于 2020-01-03 10:41:13
问题 I've just noticed that in iOS 8, a tableview which is defined programmatically must define heightForHeaderInSection in addition of viewForHeaderInSection , otherwise the default height will be 0 and the sections headers won't appear. While in iOS 7 and under the sections header where appearing even if heightForHeaderInSection is not defined. I wonder if somebody noticed the same behavior because it's not mentioned in the iOS 8 UITableView class reference 回答1: I can duplicate this issue, and

Remove 1px border under UINavigationBar - not working

ぃ、小莉子 提交于 2020-01-03 08:35:14
问题 @IBOutlet var navBar: UINavigationBar! self.navBar.setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default) self.navBar.shadowImage = UIImage() The code above works if the View Controller is embedded in a Navigation Controller and uses self.navigationController?.navigationBar.setBack ... etc, but it doesn't work when using an IBOutlet (my example is not embedded in nav controller). The navigation bar is not translucent. Any ideas? 回答1: Put this in you view controller (not in the

Send image and text with OpenGraph FacebookSDK 4.4 in Swift

帅比萌擦擦* 提交于 2020-01-03 04:16:30
问题 I am working with Facebook SDK 4.4.0 in my Swift App. Because Facebook forced the removal of prefilled text, I am trying to use Open Graph to post on Facebook content and image from my app. What I need to do is to send to the Facebook Timeline some text content and also a local image (not on the web). The image is local so it is within the app. What I achieved until now is to send the local image OR the content, but I want to send both things together. Here is the Swift code to send the image

spritekit didBeginContact three object not worked

社会主义新天地 提交于 2020-01-03 00:35:39
问题 I am tring to [didBeginContact] by three nodes. I wrote under code. But not work correctly. when white rectangle fole without hitting black or white rectangle, println("black"), and println("blue") work... whien white rectangle hit black rectangle, println("blue") work... import SpriteKit class GameScene: SKScene, SKPhysicsContactDelegate { let blackCategory: UInt32 = 0x1 << 0 let whiteCategory: UInt32 = 0x1 << 1 let blueCategory: UInt32 = 0x1 << 2 override func didMoveToView(view: SKView) {

Convert [String: AnyObject] to [String: Any] [closed]

六月ゝ 毕业季﹏ 提交于 2020-01-02 22:11:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I have a Swift variable of type [String: AnyObject] however the function i'm trying to invoke requires a [String: Any] (This would be a Dictionary fatal error: can't unsafeBitCast between types of different sizes Any thoughts on what I should do in a situation like this? Thanks! 回答1: This worked for me in a

Swift Convert decimal coordinate into degrees, minutes, seconds, direction

ε祈祈猫儿з 提交于 2020-01-02 19:12:36
问题 How can I covert this to swift? My best guess is that all the int get changed to a var. Removing all the @ that lead ". Also if any can point me to a good source to learn how things convert that would great. - (NSString*)coordinateString { int latSeconds = (int)(self.latitude * 3600); int latDegrees = latSeconds / 3600; latSeconds = ABS(latSeconds % 3600); int latMinutes = latSeconds / 60; latSeconds %= 60; int longSeconds = (int)(self.longitude * 3600); int longDegrees = longSeconds / 3600;

How to allow permission for user's Home folder in cocoa application for mac

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 17:56:13
问题 I am having a mac app in which I am deleting some data from user's Home directory. My app is rejected saying the below reason. The app only finds files in the ~/Downloads folder. It would be appropriate to have the user grant access to the Home folder. So I used NSOpenPanel for asking the access from the user but I have no idea about how to give access to user's hidden folders. EDIT I have successfully enabled sandboxing for my app but now on allow button, what should I do? Please guide me on

dyld error when trying to run an iOS 8 app on iPhone 5

淺唱寂寞╮ 提交于 2020-01-02 10:18:40
问题 Trying to run an app locally on a connected iPhone 5 with Xcode 6.0.1 (6A317). The app otherwise works on all other devices, but on the iPhone 5 I'm getting this error immediately after the app launches: dyld: could not load inserted library '/Developer/usr/lib/libBacktraceRecording.dylib' because image not found I found this relevant Twitter post: https://twitter.com/steipete/status/473620531111919616, and have tried most of the suggestions there including: rebooted the Mac & the iPhone 5