I have dozens of functions across many .m files that appropriately show in the pulldown menu on the xcode bread crumbs bar. However, last night, I added a new function to my code, but it absolutely won't show up in the pulldown list. The function before it appears. The function after it appears. Pragma marks before and after it appear. I've restarted Xcode several times. After defining the function in the .h, Xcode autofills the function name in the .m. The code in the function works fine. It just won't appear in the breadcrumbs pulldown.
I'm getting around it right now by adding a pragma mark right before the function starts. But, does anyone have any suggestions on why it's not showing in the pulldown and what can be done about it?
Spr.h
-(void) wCheck:(NSMutableArray *)CO lat:(double)target_lat long:(double)target_long;
Spr.m
#pragma mark wCheck <-- this works
-(void) wCheck:(NSMutableArray *)CO lat:(double)target_lat long:(double)target_long
{
//the code in here works fine.
}
Try forcing re-indexing of your project. Open Organizer -> Projects, select your project, delete its derived data, restart Xcode, wait for it to complete indexing.
re-indexing didn't help. I'm just sticking with the workaround of adding a #pragma mark right before the function name.
Related
Environment: Version 11.0 beta 3 (11M362v)
Here's the full text:
invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug.
This message will only appear once per execution.
Hello World
This message only appears when I click on a UISwitch button that is connected to an action; here, printing "Hello World".
Apparently the behavior of the action isn't affected.
As a comparison, I've created a UIBarButtonItem in the toolbar which behaves normally. So there's something fishy about the switch button.
Question: why would this appear and what does it mean? Remedy?
I think it's a warning that Apple should fix it itself. Even in this sample project which is from WWDC19 this problem exists. There is a UISwitch in a cell of a table. When I tap it, the mentioned warning is raised.
So, in my view, it is a bug that Apple should deal with.
Judging from the replies by Apple Developer Relations to this post, this is a bug in UIKit and one that Apple is tracking. Until the bug is fixed, the advice is to treat this as "log noise".
I had a similar problem:
When I got the call-back from the UISwitch, I reloaded the UITableView.
I think that the call-back is initiated before the UISwitch finishes changing its context, and reloading the cell in that state creates some conflict.
With that theory, I solved my problem like so:
I separated the cells into sections, where the cell with the UISwitch was in its own section.
When I got the call-back from the UISwitch, I reloaded all the sections except the section that has the cell with the UISwitch.
I have a problem to remove a warning. I added a search bar into my viewController, everything is working fine but i recieve this warning:
I updated all constraints + the position and it disappears but after reopening my project, the warning is still there. I tried every clue.
I need help please.
If you click the yellow warning indicator on the right side of the Category Table View Controller scene, you will be able to select an Xcode recommended fix for your warning (in this case you want to select the update frames option).
When I input #interface or #implemetation, there is no code completion. Others' code completion work fine. Is that function removed or it is a bug?
I've found the answer is that input interface or implemetation without #, search the list of auto completion and select "Objective-C Class Interface/Implemetation" and that is it.
If you don't see that one in the list, just page down until you find it that start with a {} icon. If you've used it once, it'll be at the first place in the auto completion list next time.
I am working on an Today Extension for Yosemite.
I would like to show a SettingsViewController instead of going into edit mode.
If I "presentViewControllerInWidget" on "widgetDidBeginEditing" it gets some weird glitches and the view controller is hiding and showing all the time.
Did anyone achieved to show an viewController on info button click or knows a workaround on that glitch?
func widgetDidBeginEditing() {
self.presentViewControllerInWidget(self.settingsViewController)
}
This worked for me:
func widgetDidBeginEditing() {
var delay = dispatch_time(DISPATCH_TIME_NOW, Int64(0.1 * Double(NSEC_PER_SEC)))
dispatch_after(delay, dispatch_get_main_queue()) {
self.presentViewControllerInWidget(self.settingsViewController)
}
}
I guess this is a bug that made it into the Yosemite release.
Documentation on widgets is very sketchy at best and it seems there are quite a few oddities in the framework.
When adding a symbolic breakpoint to widgetDidBeginEditing I get two hits when clicking the little edit button, and the edit Button becomes "Cancel". It is supposed to say "Done" though. Only after an "Add" action should it say "Cancel" (Just check out Apple's Weather widget)
Important to say: I am not using the template with the NCWidgetListViewController but my own list implementation.
If anyone finds a proper solution to this problem I'd be very happy!
Every once in a while I try to add a new data model version, and the menu item is missing. It seems the Editor menu is supposed to change depending on the file selected, and this sometimes doesn't happen. It the past I've randomly clicked, cleaned, built, etc. and eventually it showed up again with me not knowing what happened. Today it seems restarting Xcode fixed it, but I don't know if that will always work. Below are two screen shots, the first showing the wrong menu, and the second showing the correct menu. My data model is selected in both cases. Has anyone else seen this? Is it a bug, or is there some setting or selection I'm missing?
From the color of that file navigator bar I can see that you did not select the datamodel file. You probably were in "Assistant Editor"-Mode and had a .h or .m file on the right side. The active cursor was in the right file too.
The selected file shows a darker shade of gray:
The not selected file uses a lighter shade of gray:
It's important to know that the file selection highlight in the left side bar does not change when you select a different file without using the side bar. Don't trust the sidebar when you are editing files.
Click into the data model file first and your menu will be like you expect it.
Unless your are selecting the menu super fast after selecting the file (possibly not giving Xcode time to swap it out) then I say file a bug report http://bugreporter.apple.com
You should give Xcode a few moments to swap the menu out though to determine what kind of bug it is, if it doesn't swap out after 60 seconds or so then it likely isn't just a performance issue). Make sure to include a system profile as I just checked on my and every time I switched to a data model it changed the menu accordingly.
Does the same thing ever happen with xib files? Any other file types you use that sometimes have different menus?