Post

Replies

Boosts

Views

Activity

Reply to JSON DATA CORRUPTED ERROR
The error message "Invalid value around line 1, column 0." is consistent with having invalid bytes at the very start of the file. Maybe there are some non-printing (invisible) characters there for some reason? (I initially thought byte order mark, but that seems to work fine.) Try examining the file directly via this command: $ hexdump -C <path-to-your-JSON-file> | head -1 The expected output is exactly this: 00000000  5b 7b 0a 20 20 20 20 22  4e 61 6d 65 22 3a 22 49  |[{.    "Name":"I| If the first character isn’t the opening square bracket, that’s bad. Let us know what it shows.
Jan ’22
Reply to "Content View" in a custom UIView, as in Cells
Is the goal to make your custom cell type (packaged in a library) acquire custom design-time behaviors like UIKit cell types when placed in a storyboard? That is, there would be a content view already present inside your main cell view in the storyboard? Unfortunately this sort of customization isn’t supported. The user can put your cell type into a storyboard (by dragging in a regular UIView and then changing the class name) but it will always just be a plain UIView as far as Xcode is concerned. You can let the user customize your cell in certain well-known ways of course, such as by IBOutlet (maybe require the user to install their own content view and hook it up to an outlet named contentView), and you can expose extra properties via IBInspectable or IBDesignable. By “implement it all yourself” I meant that at run time you could add behavior such as re-parenting all the user’s direct subviews into a custom content view that you create, setting up constraints to achieve a desired layout style, etc.
Jan ’22
Reply to How can I compile this app?
The missing files are found in a couple of Git submodules which don’t seem to get cloned if you use GitHub’s Open with Xcode or Download ZIP options, or a normal git clone command. It works if you use git clone --recursive like this: $ git clone --recursive git@github.com:macmade/QEMU-Manager.git
Jan ’22
Reply to Erroneous output of a C++ program in MacOS that gives correct output on Windows PC
Off-by-one error: the 3rd argument to mergeSort needs to be the index of the last array element, not the array size. So you are actually sorting 14 elements including the garbage value past the end of the array, rather than 13 elements. The varying output depends on whether that garbage value sorts into the first 13 elements or not. If it always “works” on Windows then the stack may be pre-filled with a debug byte value that is always greater than 7, rather than random bytes seen on the Mac.
Jan ’22
Reply to Is there any down side to changing my CFBundleVersion from a 3 part number to a one part number.
It’s actually a good idea. Using dots is sort of a legacy format that still works, except in the case of Xcode 13’s new automatic build number management feature. That feature assumes CFBundleVersion is a simple integer and quietly truncates starting at the first dot. That’s what happened in your previous question. Consider CFBundleVersion as an internal build number. It doesn’t have to resemble your user-visible CFBundleShortVersionString in any way. You can reset it to (say) 1 every time you bump your CFBundleShortVersionString. And if you adopt the automatic build number feature, then you can just leave it alone and let Xcode bump it for you when uploading. Also consider the current documentation for CFBundleVersion to be obsolete. Someone should submit a feedback on that.
Jan ’22
Reply to Help with Xcode and curses
It’s something to make certain of us feel old. Or more specifically, “curses is a terminal control library for Unix-like systems, enabling the construction of text user interface (TUI) applications.” I recall trying to make a Hello World type of app using curses on my school’s state-of-the-art green-screen Zenith terminals around 1989, but didn’t yet have the C language skill to make much progress.
Jan ’22
Reply to Base64 encoding in JSContext
The atob() function is part of the window object in browser JavaScript, but there is no window object when using JSContext directly. One solution would be to implement the functionality in native code (Swift or Objective-C) and call it from JavaScript. See JSExport (link) and various online tutorials.
Dec ’21