Outlet works on simulator, but crashes on device - iphone

I have a very simple view with a button and a label. In XCode's Interface Builder I ctrl-dragged to get a reference to the UIButton and called it btnPlay. In my view controller I have this code:
public override void ViewDidLoad()
{
base.ViewDidLoad();
// On my phone this line causes a crash:
Console.WriteLine("Button title: {0}", btnPlay.CurrentTitle);
}
When I run the app in the iPhone Simulator (3.5" Retina / iOS 7.0) all is well. Inspecting btnPlay at a breakpoint shows it as a MonoTouch.UIKit.UIButton object.
When I run the app on my iPhone 5C (iOS 7) btnPlay shows up as a MonoTouch.UIKit.UIView object which has no CurrentTitle property and so crashes the app.
What can be the cause of this?
More info:
A stack trace from the device log crash
report
My setup: Xamarin Studio V 4.2.2 (build 2) * Mono 3.2.5 * Xcode 5.0.2 (3335.32) * Xamarin.iOS Version: 7.0.4.209 (Indie Edition) * Build date: 2013-11-11 16:04:00-0500
In my view's .designer.cs class the property is of type MonoTouch.UIKit.UIButton
In the .xib file it is a <button>
Deleting the app from the phone and running a clean build doesn't solve the issue
I can't reproduce the behaviour in a simple app with just one view and one button, so I'm asking for clues where to start looking for the problem

Related

No symbol named 'xxx' found in system symbol set

Edit: I've updated the title and question to be more specific.
I'm having trouble getting my app to run on 14.2, it runs without issue on 14.1.
The App loads 'successfully' but I'm left with a blank white screen (assume this is the loading screen) on both simulator and physical device. I get the following error on 14.2:
2020-11-17 12:38:38.090885+0000 TestApp[5191:233822] [framework] CoreUI: -[CUICatalog namedVectorGlyphWithName:scaleFactor:deviceIdiom:layoutDirection:glyphSize:glyphWeight:glyphPointSize:appearanceName:] 'triangle.fill' called with scaleFactor == 2.000000 glyphPointSize == 0.000000 at '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/CoreGlyphs.bundle/Assets.car'
2020-11-17 12:38:38.091306+0000 TestApp[5191:233822] [SwiftUI] No symbol named 'triangle.fill' found in system symbol set
I'm not sure why it's stating No symbol named 'triangle.fill' as that is a valid SF Symbols icon.
Really would appreciate any guidance?
Xcode 14. I got the same issue while setting Image in Swift UI. I mistakenly provide the image name with systemName. I was loading image from Assets.
Image(systemName: "magazine-front-cover") //use only to load system image
Instead of this
Image("magazine-front-cover") //use to load Asset image
My issue was actually related to using a TabView with PageTabViewStyle. iOS14.2 doesn't seem to like it, and was throwing all sorts of errors my way. I ended up changing my app layout, removing the PageTabViewStyle, and suddenly the 'No symbol named...' error disappeared.
Same issue for me as well. My app runs great in "all" simulators, my physical iPhone 6s, iPhone X and iPad Air 2, but crashes only on my new bought iPad Pro 12.9" 2020 (all running iOS 14.2)
The strange thing is that the error appear when I use TabView in ContentView, directing me to a sub view, containing the "no symbol" mentioned in the error message. By skipping the TabView and access the sub view directly from ContentView, the sub view works great...
In addition to this, uploading the app from Xcode to iPad goes very slowly.
Turning off "Debug executable" for both "Run" and "Test" (Product/Scheme/Edit Scheme) will help on this process, and sometimes allows my app to run for a few seconds, before it freezes again.

XPC connection interrupted in Xcode 7 for iOS 9

I recently updated to Xcode 7 and upgraded my iPhone to iOS 9. I have developed and released an iOS app that had worked perfectly fine on the latest version of iOS 8 and Xcode 6.
Upon trying to go through the process of updated the app for iOS 9 support, I am getting the most ridiculously strange error that has left me baffled.
I have done all the syntax corrections automatically through Xcode, and now my app builds properly. It even runs fine at first.
I have a button that segues to a view controller with a WebView. This view controller loads a link that will display either an image, website, or video from youtube. The content is loaded perfectly fine as always. However, the program will crash and reboot the simulator (and my iPhone) and send me to the lock screen when I click the Back button (I am on a navigation stack).
In Xcode, I get the following messages:
XPC Connection Interrupted.
Terminating since there is no system app.
I have Flurry analytics integrated in my app by the way, not sure if thats an issue.
How can I fix this issue? My searches for XPC connections do not seem to return problems similar to mine. I do not even have a clue what an XPC connection is, so why is this in my app anyway?
EDIT: I have found a workaround for the issue. I cannot really say it is a fix.
The crashing was occurring during the use of the method self.navigationController?.popViewControllerAnimated, when set to true. I happened to set this to false, and the crashing stops (now the transition looks awful).
I do not know why this works, and just adds to my confusion.
The problem lied in the storyboard for me as well. I created a new project and laid out the views and everything seemed to be working fine. I found these couple lines in the storyboard source (right click on storyboard and select view as -> source code) which weren't common between the working version and the broken version:
<keyCommands>
<keyCommand/>
</keyCommands>
I have no idea what those lines are supposed to do, or how they crept into my storyboard file, but they were what was crashing the app so hard that the phone had to restart. I removed those lines from my main project and everything worked again.
This error can be caused by executing a loop repeatedly. In my case it was a 'for' loop in which I reset the counting variable. As soon as I added an NSLog in the loop it was obvious.
I just faced the same problem. I don't know if that will help you, but I also think it's coming from the Storyboard:
In my case, the problem is coming from a UITextView. Whenever I try to change the default text inside it, I have this error. If I let the default text or leave it empty, the app works fine. Making an IBOutlet and changing the text programmatically works as well.
I tried with other UI elements, but only the UITextView seems to have this issue.
I have struggled with exact same error. Through a process of elimination I established that it had nothing to do with the any class but had to do with the storyboard. Luckily I keep regular backup copies and I tried to compare storyboards to establish what I had done - but could find nothing obvious.
The backup copy worked fine and I was able to copy my controller classes (from the faulty copy with the changes) into the backup copy and they worked fine.
I think there is a bug possibly in storyboards.
I have same error message when I place a subview in -layoutSubviews method:
-(void)layoutSubviews
{
[super layoutSubviews];
[self populateByImageViews];
}
It causes infinite cycle of layout process and crashes app. Don't place subviews in this place!
Deleting UITextView from the one of the view in Storybord removes the error in my case.
In valueChanged: method of a UIControl, I had the same problem
so I made the code inside valueChanged: to run in main thread and it solved the problem.
#IBAction func valueChanged(sender: AnyObject) {
dispatch_async(dispatch_get_main_queue(), {
//code
}
}
For me was some missing constraints with a UISearchBar, but the error was only in the simulator.
I only add some constraints and works better
For me it was xcode live issues caused by IB_DESIGNABLE
If you have any IB_DESIGNABLE in source files, the system's live tracker will check for issues in StoryBoard too. It may leads to unnecessary building.
To disable it-
Open Storyboard file. Editor -> Automatically Refresh Views (Uncheck)
If you needs to Disable Live issue tracking
XCode -> Preferences -> General -> Issues -> Uncheck Live Issues
Reference
My issue probably originated with some storyboard issue, but I cleaned the project, restarted Xcode AND restarted the simulator app and that fixed it.
When using QLPreviewController, I am confronted with this problem. Error messages as follows,
XPC connection interrupted
_BSMachError: (os/kern) invalid capability (20)
_BSMachError: (os/kern) invalid name (15)
Since XPC means OS X interprocess communication, so I think this can solve the problem, especial when updating the UI
dispatch_async(dispatch_get_main_queue(), ^{
// do what you want to do.
});
For Swift 4+, user
DispatchQueue.main.async {
//Your Code
}

mobile web app - keyboard not appearing

I have a mobile web application, working well on simulator 5.1/6.0, xcode 4.5 for iphone.
But when I test on a real device (3gs, ios 5.1), I get a strange behavior: anywhere I place an input field html element, where I need the user to fill in something, I tap the field, it gains focus (I see the cursor), but the touch-keyboard does not come up and I can't type anything. If I try it on the sim, all is fine, the kb comes up.
I am not sure how to diagnose this... tried googling for some answers, haven't found any :(
any ideas?
thanks...
ok found the issue, seems like the app was not created using the latest Xcode template (it is a legacy app), so I removed the MainWindowxxx.xibs which I don't need, and used the code from a new XCode app template to initialize the app by programmatically creating the main view controller, and setting it as the window's rootViewController. And, of course, call [self.window makeKeyAndVisible]

Unknown class [A Collection View Controller] in Interface Builder file

I wish to run iOS 6 programs on my iOS 5.1.1 iPad 1st generation, and all the UICollectionViews are all disappeared and debug console says
Unknown class collectionViewController in Interface Builder file
Is it because of incompatibility with UICollectionViews in iOS 5?
Correct. According to the documentation for the UICollectionView class, its availability is marked as "Available in iOS 6.0 and later." which means it does not exist in iOS 5.

how to add and edit 2 views in one view controller in xcode 4.2 from Interface Builder in iphone?

I am Abbas,I am new to iPhone Development,
Till tomorrow i am using xcode 3.2 sdk and build in interface builder,
I have updated my xcode to 4.2,
If i am adding another view to existing view controller by assigning IBOutlet View *view1,
and edit my new view from Interface Builder, it does not able to edit.
and also my previous Interface builder is not showing.
What i can do, Give me any suggestion,
Please Help me.
Thanks.
From xcode4, interface builder is integrated into xcode, it isn't a single UI any more.
You can easily edit it through just single click the .xib file. Maybe there is some wrong operation. I recommend you to close xcode3.2 and the project , then reopen the project only in xcode 4.2 .