Open
Description
Description
I'm testing Hot Reload for a sample .NET 9 iOS app on macOS. Unfortunately, it does not work no matter what I try (simple method, timer-called method, timer-called Action
)
Reproduction Steps
- Download the project HotApple.zip
- Run
dotnet watch run --project HotApple/HotApple.csproj -f net9.0-ios /p:Platform=iPhoneSimulator /p:BuildIpa=false /p:MtouchFastDev=true /p:UseInterpreter=true
- Change
label!.Text = $"Tick: {tickCount}"
tolabel!.Text = $"Test: {tickCount}"
- See
dotnet watch
logging🔥 [HotApple (net9.0-ios)] Hot reload succeeded.
- The label text is not updated (aside from the running count)
Expected behavior
The label changes the text before the count
Actual behavior
The label only changes the count when the timer runs
Regression?
No response
Known Workarounds
No response
Configuration
- .NET 9.0.203
- macOS 15.4.1
- ARM64
- Xcode 16.3
- iOS 18.4 in Simulator
Other information
AppDelegate.cs:
namespace HotApple;
[Register ("AppDelegate")]
public class AppDelegate : UIApplicationDelegate {
public override UIWindow? Window { get; set; }
public override bool FinishedLaunching(UIApplication app, NSDictionary? launchOptions)
{
Window = new UIWindow(UIScreen.MainScreen.Bounds);
Window.RootViewController = new TimerViewController();
Window.MakeKeyAndVisible();
return true;
}
}
namespace HotApple;
public class TimerViewController : UIViewController
{
UILabel? label;
NSTimer? timer;
int tickCount = 0;
public override void ViewDidLoad()
{
base.ViewDidLoad();
View.BackgroundColor = UIColor.SystemBackground;
label = new UILabel(View.Bounds)
{
TextAlignment = UITextAlignment.Center,
AutoresizingMask = UIViewAutoresizing.All,
Text = "Starting..."
};
View.AddSubview(label);
Action updateText = () =>
{
tickCount++;
label!.Text = $"Tick: {tickCount}";
};
timer = NSTimer.CreateRepeatingScheduledTimer(1.0, _ => updateText());
}
}