Xcode autocomplete showing results that don't exist on object - xcode

When using App Code, autocomplete will only show results directly related to my struct. This is a great feature as it keeps everything very clean and I know that accessing these properties isn't going to give me an error.
Except I don't like App Code and it's non native looking UI.
In Xcode it's quite different. Why am I getting flatMap, map, description, debugDescription?
Obviously if its my own code, I know which properties/functions are okay to use, because I wrote them. I can just ignore the noise. But if I'm using someone else's library this can slow things down. Especially when I'm just guessing or trying to remember a function.
Is there a way to fix this — to have Xcode not show me functions/properties that I can't use?

It always shows default system objects properties if the object/class is not found.
It's the behavior of Xcode

Related

startup MAUI app loads packed with errors

I'm trying to start a dotnet MAUI app following the tutorial of MS in their official docs
I'm just opening the startup MAUI project(the built-in default one) and VS22 just won't have it. I get 40+ errors most of them about reference missing and duplication of classes/functions
glimps from the errors I get
now I have already seen a post here having somewhat of the same problem but the solutions(restarting and downloading workloads from the CLI using - dotnet workload intall) just didn't work for me.
I haven't done any changes to the code whatsoever so I really don't get what is the problem here.
any help would be appreciated.
Edit 1:
The app do seems to be working when I run the android simulator… which makes it even weirder
This is a bug in the tooling at the moment it seems. If you look at the errors, especially the ones in your screenshot you can see that these talk about Android. If you expand the Project column for a little you will see the list of target platforms that it's talking about.
Because everything is in 1 project now, it gives errors about platform-specific stuff because it is only looking at that one target that it's building. In this case, maybe you were building iOS and it gives errors about not being able to find Android types. This makes sense, however, we shouldn't see these errors in this case.
It's a bit hard to explain like this, I hope it makes any sense.
Long story short, it's a bug, it's being worked on. And you should be able to ignore them and it would still run as you've already discovered yourself. It gives a lot of noise however and if there is an actual error, you will have to find that in this list and fix that.

Firestore not picking up in xcode even though it connects (reads/writes) to my database

Good day guys,
I am not sure if anyone has ever come across this problem but I would like to understand what is happening.
Firestore functions were changing colour as you'd expect untill I clean-built my project. After that none of the functions were picking up in Xcode 11.5 giving me this error: Use of unresolved identifier 'Firestore'
However, the strange thing is that my project still builds and runs despite the error and I am still able to read/write to my Firestore database.
Is this an issue with my xcode, is there a way to fix this because it is so confusing to work with?
The lack of color change means that your IDE is not recognizing the firestore functions as an included library, and the error message means that there is no firestore defined, so most probably you need to import the firestore library somewhere.

RStudio interface / behavior changes in 1.0.136

Various things are different in 1.0.136, e.g. running code with ctrl-enter has all sorts of strange behavior in an RMarkdown document, running code that has a syntax error somehow leads to all of the code being run in a block above (below?) the wrong code, etc. Sorry for not posting an MWE, but at the moment I just want to know if anyone is aware of these new "features" and if so how they can be turned off or better yet how I can just downgrade to the previous version of RStudio (which I can't currently find on the website).
Yes they changed some default settings that were present in the old interface.
Change the setting in markdown next to the knit button, from:
Chunk Output Inline -> Chunk Output in Console
Pictured here.
You can probably mess with the the Global Setting->Rmarkdowns under Tools to get it back the way it was before, but this was the fastest way for me.

Logic tests for OS X using Xcode 6

I want to implement unit testing in my Xcode project, and would like to run tests without requiring the application to be started.
Reasons for this are, I have a core data based document app, that also uses a cvdisplay link to control continuous rendering in a background thread.
It strikes me that I do not need a running application to test core data datamodel functionality, this should be distinct from view stuff anyway. Also I would like to isolate and performance test my background rendering processes, something that seems very difficult with the app running, but could easily do without the application running, just getting the right classes and feed it the correct data.
I've seen other questions that have answers for Xcode versions before six, but the answers don't seem to work for the current version.
The docs now make a distinction between application and library tests. Library tests are run against library targets.
I'm not sure i want to reorganise my code into distinct libraries at the moment, and would prefer to avoid it or fake it somehow.
I saw somewhere an openradar relating to this in ios, but I'm interested in osx.
Has anyone any insight into this?
EDIT : Learning to cope with the existing setup for now, testing with full app running, I can run some checks on that, then I close all documents and shut down the display link.
I can then run tests creating my own persistent store coordinator, in memory datastore and context, as well as testing my rendering classes without fear of conflict with the other display thread.
I'm now running into troubles with linking sources, I just can't seem to get it right, I fiddle with settings, it seems to work for a bit, then suddenly stops building again with Undefined symbols for architecture x86_64: errors, either that or problems linking with 3rd party private frameworks. I look through the web, change a few things, it starts working again. Then I add some tests, importing more of my classes, things stop working again.,.. Infuriating
EDIT 2: Pretty much all sorted now, but maybe not terribly efficient. For each test case class, I either open or close documents and start or stop the display link in the +(void)setup method. I don't do anything in the +(void)tearDown, and let the setup decide how to proceed based on the current state.
Although this means it's possible to flow from one test class to another minimizing document opens and closes, there doesn't seem to be a way to order the tests so that I could group them together.
BTW, I also solved my mentioned linking troubles (XCode 6 Testing Target Troubles), not really relevant to this question though.
It sounds like you landed on the standard solution: Give your app a way to tell when it's being stood up for testing rather than use, and then have applicationDidFinishLaunching: not do any of your usual launch-time behaviors, but leave it to specific tests to provide any setup they need.
You might benefit from creating multiple test suites to deal with different expected conditions, like all the tests that work around a specific document being open.

Lightswitch global query breaking app

I'm trying out Lightswitch for the first time, and I'm finding some of the 'built-in' features aren't as easy to implement as the videos show. The most notable being global queries, because everyone I create is causing a specific error that I cannot find a cause for. I've stripped it down to a query that does nothing but return a 'select *' on the table, and removed any code I've added.
Here is the query in my solution explorer:
And here it is in the designer:
Simple enough, so I add a screen for the query:
Everything is pure default, so why do I get this error? It says it doesn't recognize the query at all, and gives a weird dll error.
I've tried recreating it as a couple different kinds of screens, but I followed this tutorial where they use a List and Details Screen in this way. The best I can come up with is that I'm experiencing a bug due to having VS 2012 and .NET 4.5 installed as well (don't ask me why). I'm just curious if this makes sense to anyone else, or if anyone else has been successful in creating these.
P.S. - I've also been unsuccessful in accessing the permissions I created by their name. I eventually figured out I could reference them by their index, but why is that necessary? I saw nothing about needing to add a reference to make this work.
partial void CustomerNew_CanRun(ref bool result)
{
result = User.HasPermission(Permissions.AllPermissions[1]);
}
OK, just to reassure you a bit (maybe), this is not normal, & I haven't seen this or heard of anything similar.
The fact that you can't access any of your permissions by name indicates something's definitely not right. You should be able to use Permissions.NameOfOneOfMyPermissions.
Starting from the basics, have you rebuilt the solution (note rebuilt, not just built)? What you'll often find with LightSwitch is that one error will cause a whole series of other errors to appear in the list, which can look quite daunting. When you fix the original error, the rest disappear. Double-click the error in the Error pane, & you should be taken to where the error is occurring. If you can't make sense of it, past the code here & I'll see if I can figure out what's wrong.
You'll also need to check that there isn't some code left over from any previous attempt at following the tutorial. Try adding a query with a different name, & see if the error has the new name in it, or the old one.

Resources