Post not yet marked as solved
I am currently using Xcode 14.2 (14C18), but it has some glitches (which I don't want to enumerate here).
I now want to revert back to an earlier older version. Any suggestions?
Post not yet marked as solved
How can I fix this: Xcode version 14.2
Undefined symbols for architecture arm64:
"OBJC_CLASS$_FIRApp", referenced from:
objc-class-ref in libFirebaseCppApp.a(app_ios.mm.o)
"OBJC_CLASS$_FIRConfiguration", referenced from:
objc-class-ref in libFirebaseCppApp.a(app_ios.mm.o)
"OBJC_CLASS$_FIRDatabase", referenced from:
objc-class-ref in libFirebaseCppDatabase.a(database_ios.mm.o)
"OBJC_CLASS$_FIRDatabaseReference", referenced from:
objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios.mm.o)
"OBJC_CLASS$_FIROptions", referenced from:
objc-class-ref in libFirebaseCppApp.a(app_ios.mm.o)
"OBJC_CLASS$_FIRTransactionResult", referenced from:
objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios.mm.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In IB I connect a button to a VC and set the segue kind to 'Popover'. Now I have a problem. How do I get the NSPopover and its delegate?
-(void)prepareForSegue:(NSStoryboardSegue *)segue sender:(id)sender {
NSLog(@"%s: %@", __func__, segue.destinationController);
NSViewController* vc = segue.destinationController;
}
Post not yet marked as solved
Hi,
I've got some problem on launching my app,
it just only happen on real device with iOS 14.0.1,
and works well on the other versions of iOS
here is some of the error from the device log.
Mar 14 11:52:48 NC-1647 splashboardd(UIKitCore)[646] <Error>: Unknown class _TtC7MYAPP20NavigationController in Interface Builder file.
Mar 14 11:52:48 NC-1647 splashboardd(UIKitCore)[646] <Error>: Unknown class _TtC7MYAPP8LogoViewController in Interface Builder file.
Does anyone have suggestions for this problem?
Post not yet marked as solved
Hello all,
IB Designables Failed to render and update auto layout status for ViewController
After updating to XCode 12.1 I get this error every time I open Main.storyboard.
I have 3 custom view classes for UIButton, UITextField, UITextView, etc.
Tried to update pods and I've deleted DerivedData folder but that didn't fix the issue.
What could I do in order to overcome this stubborn issue?
Thanks in advance!
Post not yet marked as solved
I'm specifically talking about NSKeyValueBindingCreation. What I have to do to expose my custom properties in the Interface editor's binding inspector?
I have a simple XIB with a custom view which is subclass of NSView with optionDescriptionsForBinding: and all other methods overrides described in NSKeyValueBindingCreation. Still it doesn't work for some reason.
Is there any working example of custom NSView with exposed bindings?
Post not yet marked as solved
Our UX designer came with a strange requirement. When the user clicks the "Search" tab bar item, we need to present the search screen on top of currently selected screen. Please find the attachments. I was able to create this behaviour by using tabbarcontroller delegate methods. But during the app review, will it cause any problem as we are changing the default tab bar behaviour. Please find the attachments for a better idea.
Post not yet marked as solved
Hello, I have an application which displays the APOD (Astronomy Photo Of The Day), using NASA's API (this includes displaying the actual picture, description, author and title). I am learning how to implement Background App Refresh using the BackgroundTasks framework and simulating it using Apple's code for simulating Background App Refresh
e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"TASK_IDENTIFIER"]
My Background App Refresh Task, updates the UI from the main View Controller (including the outlets), by fetching this information from the APOD API by NASA. However, when I simulate the Background App Refresh Task, the app crashes with the following message:
2023-03-01 16:43:08.394054-0600 SpacePhoto[9069:858984] SpacePhoto/ViewController.swift:73: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
This message is pointed out in the following code line:
descriptionLabelOutlet.text = photoInfo.description
From what I have read, when my Background App Refresh Task is executed, the @IBOutlets are deallocated from memory and the View Controller references for such outlets are not being read, thus leading to the application crash.
Here is the code from my View Controller:
import UIKit
@MainActor
class ViewController: UIViewController, UIImagePickerControllerDelegate {
static var shared = ViewController()
var spacePhotoInfoTask: Task<Void, Never>? = nil
deinit { spacePhotoInfoTask?.cancel()}
// Access network request
let photoInfoController = PhotoInfoController()
...
@IBOutlet var descriptionLabelOutlet: UILabel!
...
// Send network request and assign the resulting String to the descriptionLabelOutlet
func updateInterface() {
spacePhotoInfoTask?.cancel()
spacePhotoInfoTask = Task {
do {
let photoInfo = try await photoInfoController.fetchPhotoInfo()
self.descriptionLabelOutlet.text = photoInfo.description
} catch {
print("Could not update extra Label with \(error)")
}
}
}
...
}
Here is the code corresponding to the AppDelegate:
import UIKit
import BackgroundTasks
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
BGTaskScheduler.shared.register(forTaskWithIdentifier: "Space", using: nil) { task in
self.handleAppRefresh(task: task as! BGAppRefreshTask)
}
return true
}
func applicationDidEnterBackground(_ application: UIApplication) {
scheduleAppRefresh()
print("Scheduled")
}
func scheduleAppRefresh() {
let request = BGAppRefreshTaskRequest(identifier: "Space")
request.earliestBeginDate = Date(timeIntervalSinceNow: 15 * 60)
do {
try BGTaskScheduler.shared.submit(request)
} catch {
print("Could not schedule app refresh: \(error)")
}
}
func handleAppRefresh(task: BGAppRefreshTask) {
scheduleAppRefresh()
let queue = OperationQueue()
queue.maxConcurrentOperationCount = 1
// The performApplicationUpdates method, performs the UI update (method declaration included below)
let operations = Operations.performApplicationUpdates()
let lastOpertation = operations.last!
task.expirationHandler = {
queue.cancelAllOperations()
}
lastOpertation.completionBlock = {
task.setTaskCompleted(success: !lastOpertation.isCancelled)
}
queue.addOperations(operations, waitUntilFinished: false)
print("Handled App Refresh")
}
}
And finally, here is the declaration for the performApplicationUpdates method, which calls the updateInterface() method from the main View Controller:
import Foundation
import UIKit
@available(iOS 16.0, *)
struct Operations {
static func performApplicationUpdates() -> [Operation] {
let refreshHomeViewController = RefreshViewControllerInterface()
return [refreshHomeViewController]
}
}
@available(iOS 16.0, *)
class RefreshViewControllerInterface: Operation {
override func main() {
DispatchQueue.main.async {
ViewController.shared.updateInterface()
}
}
}
How can I fix this? Is there a way to update the UI and my @IBOutlets' information using Background App Refresh?
Thank you!
This is probably an extend/ follow up of https://developer.apple.com/forums/thread/697442.
I have an app that is built based on iPad mini 5 (1024x768) and have been working fine. Recently I am working on to make it compatible to iPad mini 6 which it has two empty bars top and bottom. (Same as the issue the above thread is facing)
The debugger recognizes iPad mini 6 as 1024x768 but it should be 1133x744. I have searched online and tried below:
Turn on/ off UIRequiresFullScreen in info.plist
change storyboard source code 1133x744
switch "view as" on story board (it automatically change source code to the size but when I run it, same issue still occur)
Is there a special step that I am missing after making a change to the storyboard on xcode and deploy to the device from visual studio? I do make sure the change go through to visual studio before I start to rebuild and run by comparing source code.
I am super new to ios app development so may be missing something very simple. I am using real devices for testing (both iPad mini 5 and mini 6), they both on ios 16.1.1. I am using xcode 14.1 and visual studio to build and deploy to the device.
Post not yet marked as solved
Hi,
I am a beginner in X code creating my first project. I wanted to ask how do I create a spinner where the spinner chooses a point of interest based on the users location? For example, if the user is in London, the spinner would have local points of interest and then the spinner spins and chooses for the user?
Thank You
I have old projects without autolayout. When I open the storyboard in Interface Builder everything looks fine. But if I move a button or label by one pixel, for example, or add a new UIView, then the Interface Builder randomly changes the x, y, width, or height values for almost all elements in all UIViewControllers in the storyboard file. Not all values are changed, but a lot. If I close and open Storyboard a few times and do an action, the values are changed so many times that the user interface is completely broken.
Does anyone have an idea how I can fix the problem? I am using Xcode 14.0.1 and it happens with all projects I have.
The changes look like this, for example:
Post not yet marked as solved
Hi all, I'm struggling with a pretty strange problem and I can't find a solution on how to fix this.
Basically if I add a UIView as header of a UITableView with large titles enabled, the large title starts collapsed and is not large by default. In all others cases, when I push a view controller with a UITableView without the header view, the large title starts large as I wish.
My desired large title behaviour is to see it large also here when I push this view. What I'm doing wrong on?
Thank you in advance.
I've attached some screenshots from Storyboard (already from here you can see that the large title gets smaller as soon as I add the view as header) and also a screen from the running app.
Storyboard screens:
First opening on running app (it starts collapsed):
After scrolling it enlarge correctly:
PS: I've also found this question on StackOverflow with the same problem of mine, but with no useful answers.
https://stackoverflow.com/questions/59263994/swift-preferslargetitles-not-working-if-there-is-a-headerview-in-tableview
Post not yet marked as solved
I have a window with a split view and I want top and bottom to scroll a subclass of NSTextView. I set them up identically and linked to a custom window controller class, but when the nib loads only one gets the custom class. The other one always gets plain NSTextView class. Even more curious, the one that does not get custom class is IBOutlet named "outputText" in my code. If I change the name to something else the nib loads nothing at all. If I change back to outputText, it gets NSTextView again. In fact, it is loaded as NSTextView and assigned to my IBOutlet even if I do not make that connection in the nib file. I tried clean and rebuild several times, but no help. I even looked in the raw nib XML and can see custom class is set, but it is not used.
The connections in my window controller class are
IBOutlet TextViewWithHelpMenu *commandText;
IBOutlet TextViewWithHelpMenu *outputText;
Attached are pictures of how these are connected the same way (but only one works):
Post not yet marked as solved
With the recent update to Xcode 14.1 (also seen on Xcode 14.2), the project files get modified automatically every time it is opened. This behaviour is not seen in Xcode 13.4.1.
Our project files are sorted alphabetically. Whenever the workspace or .xcodeproj is opened using Xcode 14.1 or 14.2, the pbxproj gets modified and the file references gets sorted based on the alphabetic order of the unique reference identifier as show in the below attachment. Is there a way to prevent this ? If this is a bug on the recent version of Xcode, ie 14.1 or 14.2, could you please acknowledge and address this in the next version ?
Post not yet marked as solved
Hello,
I have been working with storyboards for my projects without any problems.
However, since the XCode Version 14.0 (14A309), the "safe area" on the storyboard preview is wrong for landscape orientation, as you can see in the image below:
The "safe area" acts as in portrait (with margins on top and bottom) instead of margins on the left and right side as in the previous version. Also changing the device for preview does not help.
It seems to affect only the preview, as the safe area is well in place after building it on both iPhone 13 and iPhone 12 mini.
Do you have any idea how to fix this? Or is it a bug that should be fixed by the Apple developer team?
Thanks
Post not yet marked as solved
I have a combobox in a View Controller that I am trying to populate using an enum. I did some research and think I've done it correct but whenever the view controller launches, I get an error Illegal NSComboBox data source.
I thought it may be an issue with the ComboBox (It was copied from another one in the View Controller) so I tried creating one from scratch but I am getting the same thing. I can populate the ComboBox using the addItem no problem.
The Combobox does have Use Data Source selected in the Storyboard. Here is my code;
enum Server_Locations: String, CaseIterable {
case us = "United States"
case canada = "Canada"
case other = "Other"
}
class PreferenceController: BaseVC, NSComboBoxDelegate, NSComboBoxDataSource {
@IBOutlet weak var countryComboBox: NSComboBox!
override func viewDidLoad() {
super.viewDidLoad()
countryComboBox.dataSource = self
countryComboBox.delegate = self
numberOfItemsInComboBoxCell(aComboBox: countryComboBox)
comboBoxCell(aComboBox: countryComboBox, objectValueForItemAtIndex: 0)
}
func numberOfItemsInComboBoxCell(aComboBox: NSComboBox) -> Int {
return Server_Locations.allCases.count
}
func comboBoxCell(aComboBox: NSComboBox, objectValueForItemAtIndex index: Int) -> AnyObject {
return Server_Locations.allCases[index].rawValue as AnyObject
}
It seems pretty straightforward but I'm obviously doing something wrong? I think the issue is in the calls to numberOfItemsInComboBoxCell and comboBoxCell
I've checked some examples online and they have referencing outlets to the delegate and the dataSource but I am defining them in the viewDidLoad().
I'm using Swift 5 in Storyboard mode with XCode 14.2
Post not yet marked as solved
I have a view controller that is attached to my main menu via Segue and I am trying to figure out how to programatically call that segue?
I can't use the performSegue() as when I try to use it on an NSMenu object, I get an error saying NSMenu has no method performSegue.
I tried just calling self?.performSegue(withIdentifier:"mySegueName", sender: nil) from another viewController where I want to call the segue but the segue doesn't exist in that viewController so I'm assuming that's why it does nothing.
Does anyone have any suggestion as to how I can call this?
Post not yet marked as solved
I’m seeing an anomaly with the storyboard in my project. Within a UIViewController, an element starts shifting its position to the left and down by one each time the project is opened. It's not limited to any particular type of control. These screenshots are a UIScrollView, but it happens on UITableView, UITextView, etc.
I'm not using auto layout. Thanks for anyone's help!
.
How to get rid of this warning?
NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. I do not set minSize or maxSize, it is Interface Builder that seems to do this. Even if I create completely new interface from scratch, this warning still appears.
What is the point of introducing this warning if Apple tools unable to produce correct behaviour?
Post not yet marked as solved
I would like to have a fullscreen "view" that slides up from the bottom after a user action, and that can be swiped down smoothly like a "sheet".
I understand that there are sheets that are swipable, but dont really cover the fullscreen, and then that there is fullscreencover which does cover the full screen but is not swipable.
In apple music, whenever you click on a song, a fullscreen "modal" slides up from the bottom, and is swipable. How can I achieve that. I'm guessing if apple does it on their apps, they allow users to have the possibility to achieve the same results.