xcode

I don't understand a completion handler and I need one in my code

让人想犯罪 __ 提交于 2021-01-29 17:44:08
问题 I capture the data from Firestore and assign to array, someone in other question told me maybe I need a completion handler but I don't understand how to work, it would be very helpful if you help me with the code and explain this concept to me. class PetsTVC: UITableViewController { var db: Firestore! let uid = Auth.auth().currentUser?.uid var petslist = [String]() var pid = "" var pets = [paw]() override func viewDidLoad() { super.viewDidLoad() self.loadPets() DispatchQueue.main.async { self

How can I continue working on OpenGL with macOS Catalina 10.15.4?

早过忘川 提交于 2021-01-29 16:51:52
问题 I am trying to work with OpenGL on macOS Catalina 10.15.4 but there is a error; GL/glew.h GL/freeglut.h file not found! My code // main.cpp #include"GL/glew.h" // error; 'GL/glew.h' file not found #include"GL/freeglut.h" // error; 'GL/freeglut.h' file not found #include<iostream> #define GLEW_STATIC void display(void) { } int main(int argc, char *argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition(500, 200); glutInitWindowSize(500

How to get user input from UItextfield and add it to an array?

僤鯓⒐⒋嵵緔 提交于 2021-01-29 15:51:45
问题 I am working in swift. I have a textfield that is in a tableview cell. I am trying to store the text of each text field in the tableview so they when the user adds or deletes a row, and then the tableview reloads data, that the text fields stay filled in with the appropriate data. I tried adding a textfielddidendeditting function but for some reason it is not being called. EDIT: Here is my code: tableViewController: import UIKit var rowCount = 0 var textArray = [String]() class

How to code for a specific view contoller? - Apple Swift/Xcode

心已入冬 提交于 2021-01-29 15:38:53
问题 I am trying to code a basic calculator for a specific view controller in my project, but I don't know the function to call my specific view controller. I expect to be able to connect my outlets, but I can tell that it has to be in the scope of a specific function. I am unable to connect an outlet from any view controller other than the root. I'm a student, and I've tried to look up function names for a specific ViewController, but I cannot find the right result. Thanks in advance! 回答1: first

reload map after calling urlsession data

匆匆过客 提交于 2021-01-29 15:36:16
问题 I am new in swift , I implemented a MapKit with static data , and it worked fine , and I called after that backend pins data and it showed in the playground that it works fine , but the map is not displaying the markers , it seems that the mapKit do not capture the pins data in the right time , so I used Dispatch.Que to refresh the map but I did not refresh and it is displaying without the markers here what I have tried : import UIKit import MapKit class myMapViewController: UIViewController,

react native splash screen get 'React/RCTBridgeModule.h' file not found

自闭症网瘾萝莉.ら 提交于 2021-01-29 14:55:26
问题 I started a new react native application using : react-native init myApplication I started with splash screen so i used this library react native spalsh screen I linked the library to generate native code using this command : react-native link react-native-splash-screen And i added files using Xcode like this : In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name] Go to node_modules ➜ react-native-splash-screen and add SplashScreen.xcodeproj In XCode,

Showing Recent Issues clang: error: linker command failed with exit code 1 (use -v to see invocation)?

南笙酒味 提交于 2021-01-29 14:40:11
问题 I am new to IOS app development..I trying to integrate firebase firestore..After doing all add commands..I build using command+B then I am getting below errors...how to solve Below is my error Below is my project structure 回答1: Try to open project.xcworkspace instead of project.xcodeproj . Note: Press Command + Q to exit xcode. And open yourfile.xcworkspace . 回答2: Clean your project and build again solve your problem. Product - Clean Then also, if error is still there delete you derived data.

AppleScript from App Error: skipped scripting addition “/Library/ScriptingAdditions/Adobe Unit Types.osax” because it is not SIP-protected

扶醉桌前 提交于 2021-01-29 14:38:30
问题 Trying to run a script from our app and get this error message, even with something simple like: tell application "Finder" display dialog "Hello World" end tell Have set the appropriate Entitlements like: "com.apple.security.scripting-targets" and "com.apple.security.temporary-exception.apple-events:before:10.8" App has nothing to do with Adobe... 回答1: The "skipped scripting addition..." error is merely a warning, not a fatal error. It is informing you that it tried to load a particular

I am not sure why I keep getting the error Value of type '(AnyObject) -> ()' has no member 'currentTitle'

若如初见. 提交于 2021-01-29 14:10:12
问题 @IBAction func Hint(_ sender: UIButton) { if Action.currentTitle != Int(rightAnswerPlacement) // this is the line where I keep getting error I posted above { Action.isHidden = true // true to hide the button } } @IBOutlet weak var Hint: UIButton! //Label for qs @IBOutlet weak var label: UILabel! //button for choices @IBOutlet weak var Action: UIButton! @IBAction func Action(_ sender: AnyObject) { if (sender.tag == Int(rightAnswerPlacement)) { print("Right") } else { print("Wrong") let alert =

Unable to Resolve Build File: Reference to Missing Target with GUID

ⅰ亾dé卋堺 提交于 2021-01-29 14:00:22
问题 I recently forked an iOS library on GitHub to add support to it for the Swift Package Manager. Here's the repository: https://github.com/skelpo/mapbox-gl-native-ios When I add it to a completely new iOS app and try to build it, I get this error: Unable to resolve build file: XCBCore.BuildFile (The workspace has a reference to a missing target with GUID 'PACKAGE-TARGET:Mapbox') I've found posts for similar errors, such as this one, but the reason for the build file failing to resolve is