Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

d0zz0r

macrumors newbie
Original poster
Aug 10, 2021
10
0
Hello everyone. I need so help with next question:
I have mini-quest, need to create alert window, that will show to user over all windows. I search in Google for samples and found info about "NSAlert". I try to use it and that's work ok. I have compiled sample from XCode. When i write same code in source file and try to compile it from cli, i have next issues: 1) window(NSAlert) open but not over all windows, just some in background 2) TextField that i create inside this cannot be active.
What's i do wrong and how resolve it ? Thanks much!
 

d0zz0r

macrumors newbie
Original poster
Aug 10, 2021
10
0
Windows and alerts can have different levels, but without seeing some code I can’t make a guess.
bro, second thread, second flood answer. I specially write: same code from XCode and from CLI. If u don't know - don't flood plz. Thanks
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
If you don’t want people to help, you can keep on asking questions this way.
That is why your Network Access topic on StackOverflow was closed, by the way.

This is sounding more like an X-Y problem. How are you compiling the project using the command line?
 

d0zz0r

macrumors newbie
Original poster
Aug 10, 2021
10
0
If you don’t want people to help, you can keep on asking questions this way.
That is why your Network Access topic on StackOverflow was closed, by the way.

This is sounding more like an X-Y problem. How are you compiling the project using the command line?

With gcc.
 

Daurora

macrumors newbie
Aug 11, 2021
1
0
From the questions being asked I'd say someone is trying to write a piece of mac malware...
 

d0zz0r

macrumors newbie
Original poster
Aug 10, 2021
10
0
Lol. Because i want compile from CLI ? And won't create view's /e.t.c. with IDE ?)
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
With gcc.
Obviously you would be compiling your project with gcc or whatever (Xcode does the same thing using llvm/clang), but that doesn’t answer the question. If the project works OK with Xcode but doesn’t with something else, then the problem would be with that something else and/or how you are using it (or your expectations on how it should work).

We can go back and forth like this, with you providing 3 or 4 words at a time until enough information is dragged out to make a guess, but since you don’t seem to know how to ask these kinds of questions, perhaps a better way would be for you to provide a minimal, complete, verifiable example that demonstrates the issue (including stuff like the version of gcc, arguments you are using, and anything else needed to build the project). In this way, people wouldn’t be wasting their time with a 25-reply topic just to find out you aren’t using a run loop or the correct bundle structure that macOS applications require.
 

Senor Cuete

macrumors 6502
Nov 9, 2011
424
30
...2) TextField that i create inside this cannot be active...
An alert doesn't have editable text fields. It's a warning to the user that something needs his attention. There's no way to respond to user input. It's quite easy to create a custom dialog to do what ever you want but this would usually be created from a template in a resource file, using interface builder. Why are you trying to use CLI to develop a Mac app? It sounds like it sux.
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
An alert doesn't have editable text fields.
An NSAlert can have an accessory view with whatever you want in it. I used to use it for all kinds of stuff (including text fields) until Apple made them vertically oriented and ugly in Big Sur. I also try to stay away from using Xcode, programmatically creating the UI and only using the Interface Editor for complex layouts, but I use a toolchain that does the build stuff.

A text field not being active is a small clue, but without (a lot) more information who knows…
 

Senor Cuete

macrumors 6502
Nov 9, 2011
424
30
Hijacking the thread but how do you debug your code? You don't have the code analyser or the smart text editor. How do you replace the many useful features of Xcode.
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
... how do you debug your code? ... How do you replace the many useful features of Xcode.
For debugging, along with compiler and runtime messages, DWARF/dSym files are generated by many build systems (for stuff in the field, a crash log or stack trace is pretty much all you get). I'm not sure which "useful features" you are referring to, but if you are talking about the text editor, I’ve never really used those in the first place (I am guessing that is also true of the OP), and have no need for most of them. The Xcode IDE doesn’t directly support my language of choice anyway, so it is hard to justify for just a text editor when there are many others that may be more familiar.

Xcode is hard to explain, it must be experienced (Vim and Emacs are probably the same way, but I digress :p) - that is why a lot of the online tutorials are more about how to use it rather than whatever code is being talked about. Add in that it is constantly changing, and for someone trying to learn the APIs and possibly also coming in from another platform, I can see why they would want to skip Xcode for command line tools (the usage doesn't change much) with stuff they already know.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.