Apple Watch App Only Showing Clock - xcode

Xcode states that the Apple Watch is running but yet I only see the clock. My storyboard interface should have a green background. There is nothing showing up in the slog.
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
NSLog(#"hello world");
}

After deleting and re-adding the storyboard into the app section, the NSLog now shows results again and the apple watch is showing the storyboard again.

Related

Unable to launch iOS 14 app on device while connected to Xcode 12

Having an issue running any app with Xcode 12 on a physical device (device running 14.0.1)
Starting with a new project, the simple Hello World app will not launch on my device while connected to Xcode.
The screen remains black with the white bottom home bar showing. Xcode shows app is running, no warnings, no errors.
struct ContentView: View {
var body: some View {
Text("Hello, world!").foregroundColor(.red)
.padding()
.onAppear {
print("Working....")
}
}
}
It works fine on the simulator, and thus prints out the debug text.
But, on my device, I do not get the debug text - so the launch process has failed.
However, if I stop the project on Xcode and then run the installed app on my device the app runs as expected!!
I changed the font color a couple of times, and it correctly installs the app to the device but fails to run when connected to Xcode, but works when running the app on the phone
I unpaired my device that didn't help.
No sure what to try next...
Thanks for any suggestions
I pass on this solution, which fixed this issue for me:
Go to Xcode -> Preferences -> Locations.
Tap the little arrow under the Derived Data section to open the Xcode directory in the Finder:
Quit Xcode.
In that folder, go to the folder "iOS DeviceSupport":
Delete all the folders within the "iOS DeviceSupport" folder.
Restart Xcode.
If you use wireless debugging you'll probably have to reconnect your device to your computer to re-establish the connection.
Build your project.
Of course, it probably helps to be on the latest Xcode (12.0.1 as of writing) for this.

InputAccessoryView does not show on iOS 8 simulator

I have iOS application since iOS 5, it includes a custom UITextView which use its own inputView and inputAccessoryView. It works with iOS 7 simulator, when it becomeFirstResponse, both inputView and inputAccessoryView show, but with iOS 8 simulator, only associated inputView shows, the inputAccessoryView does not show.
I am using Xcode 6 GM seed
HeInput_TextView.m
- (void)awakeFromNib
{
self.text = #"";
heKeyboard4x5 = [[HeKeyboard_ViewController alloc] init];
inputAccessoryVC = [[InputAccessory_ViewController alloc] init];
self.inputView = heKeyboard4x5.view;
self.inputAccessoryView = inputAccessoryVC.view;
}
Is it a bug in iOS 8 simulator or a change for iOS 8?
Edit:
I found more information about this problem.
This problem happens in Page-Based application, if an UITextView in a page of UIPageViewController, then the UITextView.inputAccessoryView doesn't show at iOS 8 simulator, but shows in iOS 7.1 simulator.
I creates two projects: 'Single-View Based application' and 'Page-Based application', and confirmed the problem happens as described above.
it is new behaviour of simulators in xcode 6. to see your custom accessory view or even default one try to uncheck hardware -> simulator -> connect harware keyboard.
It's an iOS8 bug.
You can reproduce it on the simulator in Apple's Contacts App.
Add a new contact and scroll down to "add a date".
Same problem. A colleague has raised an apple rdar.
I've found view accessories in iOS8 don't use the view's frame to offset their height above your InputView (or even the default software keyboard).
You might need to make sure your inputAccessoryView implements
-(CGSize)intrinsicContentSize
eg:
#implementation InputAccessory_View
// .. your code ...
-(CGSize)intrinsicContentSize{
return self.frame.size;
}
#end
My apologies, I misread the item. I've been driven batty by iOS8's keyboard issues.

idleTimerDisabled not working under iOS8 Gold Master

We have a video recording app which has worked fine under iOS6 and 7 and we thought it was working fine under the beta versions of iOS8. Since we have the Gold Master we are often pushed to the background when the iOS idle timer kicks in. We have the line:
[UIApplication sharedApplication].idleTimerDisabled = YES;
in our code and this has been sufficient until now. Does anyone know why this is not working all of a sudden.
Thanks
If you show a keyboard and dismiss keyboard after setIdieTimerDisabled, the idleTimerDisabled will not work automatically on iOS 8.
I don't know why, but these code could fix my problem:
- (void)onKeyboardDidHide:(NSNotification *)notification
{
if (!SystemVersionLessThan(#"8.0")) {
//reset it again.
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
}

iOS Simulator has black Keyboard and Alerts in iOS7

My App runs on iOS 6 and 7, on the devices it looks fine and on the simulator iOS6 it is fine but in iOS7 all alerts, keyboards and parts of table and collection views have elements that are completely black. They are there if you clock on them. It is hard to explain but you can see from the image.
I think it is do with the fact that I run a lot of things in the background and when I do any UI and force to the main thread (but this could be a red herring).
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^(void)
{
[self backgroundbits];
....
....
dispatch_sync(dispatch_get_main_queue(), ^
{
[self updateProgressBar];
});
....
....
....
});
Another options is that I have messed up the transparency and tint somehow.
It is just strange it ONLY does it on the iOS 7 simulator.
I have experienced this before. I just resorted the simulator (iOS Simulator > Restore Content and Settings), cleaned my Xcode Project, and quit and reopened Xcode. This solved the problem for me!

Main window doesn't run properly on Snow Leopard

My app developed in Xcode 4.5 on Mountain Lion runs flawlessly on Lion and ML.
My Snow Leopard tester reports that when the app starts, it is disabled. By that he means none of the controls are active and the red, yellow, green 'traffic light' is greyed out. If another app is opened that covers my app, when the covering app is moved, any control, or part of a control it covered is not there.
The menu bar is responsive, and my preferences panel works. The app can be shut down from the menu, I don't know if it can be shut from the keyboard.
Another app that uses the same serial code works fine.
I need help with putting together a plan to solve it. I don't know how to trace this.
Fundamentally, the problem is that you're expecting data to be in NSUserDefaults. On first launch, NSUserDefaults returns nil for the keys you access, and passing this nil result through later code causes exceptions to be thrown. The solution is to register defaults with NSUserDefaults upon application startup:
#implementation AppController
+ (void)initialize
{
NSDictionary *defaultValues = #{#"SomeKey" : #"DefaultValue"};
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
}
#end

Resources