FBLoginView read permissions doesn't work - ios

I created an app which asks user to login with Facebook. This part of code was working totally perfect on each device:
self.facebookButton.readPermissions = #[#"public_profile", #"email"];
self.facebookButton.delegate = self;
But I found that it doesn't work on iPhone 6 (device or simulator). Error is about method
[UIButton setReadPermissions:] unrecognized selector.
Anyone help me, I just have no idea what it can be and how I can fix it

Nvm, guys, I've figured it out. I had the problem with UIController (didn't connect login view with outlet). I'm sorry for wasting your time.

check whether the self.facebookButton is the instance of FBLoginView. if yes, please
declare it as strong.
#property (nonatomic, retain) IBOutlet FBLoginView *facebookButton;

I had the same issue, so I'll leave my solution here in case it helps someone out. I'd changed the class on the Main.storyboard to be a FBSDKButton instead of a UIButton, but there was another storyboard file localized to Spanish that still had it as a UIButton.

Related

exc_bad_instruction(code=exc_i386_Invop subcode=0x0) xcode

I am using xcode with the language swift. I continue to get this error on all of my code. exc_bad_instruction(code=exc_i386_Invop subcode=0x0) xcode. I have seen other questions and none make sense. I'm not sure if it is because of the second view but here is the code.
enter image description here
It has two views so I don't know if thats the problem. I need help!
Seems like the iboutlet is not connected in storyboard, because of which it is not getting initialised, no memory allocated to this object. Kindly check your storyboard connections.

Rendering Video using XCDYouTubeKit and swift

Please bear with me as I have been trying to program in iOs using swift for a week now and at the moment I am stuck on an error. I need some insight with what is wrong with what I am doing.
Screenshot of Storyboard and .swift file
Screenshot of my error
I am gonna guess you have resolved it. Usually that error comes when you deleted an IBOutlet from the interface side of code but you still have it left behind in the the storyboard. Delete the "test" IBOutlet from the storyboard and that should fix it.

WatchKit Extension - Unable to find image named “XXX” on Watch

Ii'm just trying to set text into a WKInterfaceLabel but its telling me no image find with this name.
Here is the code
#property (weak, nonatomic) IBOutlet WKInterfaceLabel *testTextBox;
_testTextBox.text = [NSString stringWithFormat:#"%#", testString];
It is not related with this code. You must check all WKIntefaceImage's names. if you have wrong one than this error appears like this. If you recheck all WKIntefaceImage's names you will see there is have a wrong one.
click on the image file, you'll see "Target Membership" options on the right pane. Select all of them, Clean the build and try again.
If anyOne still got the same issue:
Might by You copy cell in InterfaceBuilder with some old outlet or action connections.
So just remove old outlet connections and reconnect the new one.
I made the same issue, just try it!
For me the above fixes, individually, didn't work.
Make sure your images end in "#2x" (before the extension .png/.jpg)
Drop them into the blue Assets folder/catalog.
Delete the app from your simulator or device (this solved it for both of them for me)
It looks like once you gum things up with bad naming it doesn't recover. Removing the app, fixing the naming and reimporting into the catalog fixed my issues.
Coding for the watch is still tough, and I rely on tips like this to get through the 'gotchas'.
🍀
Clean the project and Delete your app in simulator, error will be gone.

IBOutlets not showing on XCode 6.1 (6A1052d)

This is quite a major problem: the Outlets are not appearing in IB.
To reproduce:
1) I declare a variable to be IBOutlet, for example in my view controller's .h file
#property (nonatomic, strong) IBOutlet UILabel* testlabel;
2) I open the storyboard, click on the viewcontroller.
- If this is a new project, there is no "Outlets" list.
- If this is an old project with outlets already defined, the "Outlets" list contains the previous outlets, but not the one I've added.
Has anyone had the same problem. This is really important, as I can't basically proceed unless I stop using Outlets. I can't find any info about it on the release notes.
EDIT I'm adding a video on youtube showing the problem, in case I haven't explained it properly. If I'm forgetting something obvious, I'm happy to be laughed at :) That said, I've always been following these same actions and Outlets have always been in the list.
EDIT 2 For clarity, I've removed the ivar declaration as it seemed to get most of the attention.
Outlets on Youtube
EDIT 3 Ok I seem to be hitting a problem seen previously on this question and this other question. Basically, if I open the custom class drop-down, I see only some "standard" classes, such as UIViewController. If I select any of these, I get the Outlets. For example, for UIViewController I always have that view->View. However, my project's classes are not in the drop-down. Entering the name manually seems to work, but in fact it's not. There must be some indexing issue (except I've already deleted everything from
~/Library/Developer/Xcode/DerivedData/
without success. If you wish to try, I've put my code on GitHub. This doesn't show the Outlets for me, but it does for a number of other people - so it's not a "bug" with the code strictly speaking. It's more an XCode issue. Any help would be welcome!
EDIT 4 I think here's the problem, pretty much: look on the right. The drop-down menu doesn't show the "ViewController.h" class. If I enter it manually, it seems to recognise it but in fact I suspect it doesn't. In previous times, I was always seeing the full list of my project's classes in the drop-down menu.
I've found a "solution", or workaround. Deleting the XCode data is not enough, and it's not enough to just restart it. The following sequence makes the Outlets magically re-appear and work properly:
Clean project
Close XCode
Delete all contents of ~/Library/Developer/Xcode/DerivedData/
Restart MacOs
By doing this, when you re-open XCode and it reindexes, it will show the outlets as expected.
just declare the IBOutlet like this:
#property (nonatomic, strong) IBOutlet UILabel* testlabel
Maybe a very dumb one, but have you tried Clean Project Folder, then deleting DerivedData (while Storyboard is not open), immediately quit Xcode, and opening up Xcode again, then building your project?
I ran into a similar problem, but it was due to a bug in Xcode (8.2) where Interface Builder doesn't show outlets in the Connection Inspector if those outlets have been declared with a _Nullable type annotation for Swift compatibility.
Using nullable inside #property's parentheses appears to work around the problem.
(I know the original poster's problem did not use type annotations or Xcode 8 so was slightly different, but the question summary matched my internet search so I mention this for future searchers.)

iOS app crashes when set UITextfield delegates

I dont know why the iPhone app crashes and it gives lldb error only.I tried to add the exception break point too.
.h file:
IBOutlet UITextField *etCountry;
.m file:
etCountry.delegate=self;///
This is the line i am getting the crash.Please give me the solution for me
Make sure your textfield has connection like this below images,
This is how
self.etCountry.delegate=self;
And add
#interface YourViewController ()<UITextFieldDelegate>
#end
You may check other threads, and their stack. My guess is that there is everything is fine with text field. Seemingly there seems a network call also in the background, maybe a callback block is not in the right format. That caused similar "hidden" crashes to me.

Resources