Questions tagged [xamarin.ios]

Xamarin.iOS (previously known as MonoTouch) is a commercial software development kit for Mac OS X and Windows that lets you use C# (a .NET programming language) to create native applications for Apple iPhone, iPod Touch, iPad (iOS), Apple Watch (watchOS) and AppleTV (tvOS) devices.

Xamarin.iOS (previously known as MonoTouch) is a cross-platform implementation of Microsoft's CLI (.NET) that lets developers write "once" for iOS, OS X, Android, and Windows Phone in C#.

Xamarin comprises an IDE (Xamarin Studio for OS X and Windows), a plugin for Visual Studio, and libraries for each of the target OS's. Xamarin implements a hybrid approach to cross-platform development, whereby business logic exists in a shared core project, and the visual layer is implemented in platform-specific projects for each target platform.

Developers thus have access to advanced C# language features and libraries, as well as platform-specific UI libraries. To comply with Apple policy, iOS and OS X apps compile "all the way out" so as not to require a runtime.

16577 questions
26
votes
2 answers

What is correct way to combine long-running tasks with async / await pattern?

I have a "High-Precision" timer class that I need to be able to be start, stop & pause / resume. To do this, I'm tying together a couple of different examples I found on the internet, but I'm not sure if I'm using Tasks with asnyc / await…
26
votes
2 answers

Deserialize to IEnumerable class using Newtonsoft Json.Net

I have a project that is currently using Json.Net for Json deserialization classes like these: public class Foo { public Guid FooGuid { get; set; } public string Name { get; set; } public List Bars { get; set; } } public class Bar…
redent84
  • 18,901
  • 4
  • 62
  • 85
25
votes
3 answers

How to go from NSData to byte[]

If I have image data in an NSData, extracted from the image as follows, how do I convert this NSData object into a byte array? NSData data = NSData.FromUrl(NSUrl.FromString(urlString));
BruceHill
  • 6,954
  • 8
  • 62
  • 114
25
votes
9 answers

Xamarin iOS simulator issues - The device was not found

I am trying to use the Xamarin iOS simulator but it fails on launch with a "The device {guid} was not found". I have my environment settings like... and when I run I see... then... researching the error, the recommendation is to explicitly set…
John Livermore
  • 30,235
  • 44
  • 126
  • 216
25
votes
6 answers

What happens to an iPhone app when iPhone goes into stand-by mode?

My app uses NSTimer and it appears that NSTimer doesn't fire when the iPhone goes into the stand-by mode (either by pressing the hardware button or by the idle timer). When I activate the iPhone again, my app is still in the foreground. What happens…
subjective-c
  • 1,833
  • 9
  • 25
  • 35
25
votes
15 answers

I can't connect to Mac with Xamarin Mac Agent from Visual Studio 2015

I'm continuing my adventure with Xamarin. I'm developing an Xamarin Forms application with a Portable Class Libraries (PCL). I have compiled and debugged my application by Android, but now, I'm interested to run the application in iOS to test in…
stivex
  • 657
  • 1
  • 8
  • 20
25
votes
6 answers

Redraw UITableView after updating data async

I have a UITableview that I load with data async so the tableview might appear without data. I have tired the ReloadData method but the tableview remains empty until I scroll the tableview, suddenly the data appears. The same thing happens when I…
Jimmy Engtröm
  • 1,998
  • 4
  • 23
  • 34
25
votes
3 answers

Do I programmatically add SubViews in ViewDidAppear, ViewDidLoad, ViewWillAppear, the constructor?

I'm trying to figure out from Apple's sketchy documentation which method is the best place to be initializing and adding my Views controls to the controller's view. With winforms it's fairly straightforward, as they're always initialized inside…
Chris S
  • 64,770
  • 52
  • 221
  • 239
25
votes
1 answer

How to force Monotouch AOT Compiler to see a nested generic method?

I've had to jump through hoops, but I've almost managed to get ServiceStack working on iOS with Monotouch in my project. One runtime JIT exception is holding out: System.ExecutionEngineException: Attempting to JIT compile method…
Felix
  • 1,346
  • 1
  • 12
  • 25
24
votes
2 answers

Detect whether an UIImage is PNG or JPEG?

Currently doing my first steps with iPhone development through MonoTouch, I am playing with an UIImage that I read from the photo library. What I want to achieve is to get the raw byte array (byte[]) of the image. I know that there are the…
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
24
votes
3 answers

How to get width and height of iPhone/iPad using MonoTouch?

I need to get the width and height of iPhone/iPad using MonoTouch. How to get programmatically?
bharath
  • 14,283
  • 16
  • 57
  • 95
24
votes
8 answers

Targeting/Developing for multiple mobile platforms with one programming language (C#)? Cost-Benefit?

Today it is possible to use C# programming for multiple mobile platforms such as: WindowPhone7 Android - Monodroid iPhone - Monotouch (feel free to edit if I missed some) Of course, it is still programming effort for UI, but main libraries of app…
nemke
  • 2,440
  • 3
  • 37
  • 57
24
votes
2 answers

error MT0117: Can't launch a 32-bit app on a simulator that only supports 64-bit apps (iPhone 6s)

Using Xamarin.Forms, Visual Studio 2017 on a PC, and MacBook Air for building the mobile application to iOS. Yesterday, I updated the Visual Studio version to 15.3.5. I also updated the MacBook Air (via VS for Mac) to get the latest version of iOS…
Dimitris
  • 725
  • 1
  • 10
  • 28
24
votes
6 answers

Anyone successfully used password on sqlite database in Monotouch?

I have a Monotouch app which uses a sqlite database. I want to encrypt the database so I am doing this: _mainConnection = new SqliteConnection("Uri="+finalDB); _mainConnection.Open(); _mainConnection.ChangePassword("mypassword"); However, its not…
therealtkd
  • 385
  • 3
  • 9
24
votes
5 answers

Create a hyperlink using Xamarin.Forms (xaml and c#)

I basically want to create a hyperlink in Xamarin.Forms using the label class. Basically, I want to following link to take the user to google.com in a web browser:
jnel899
  • 563
  • 2
  • 8
  • 21