Tag: io

58 votes
7 answers
1.6K views
What exceptions should be thrown for invalid or unexpected parameters in .NET?

What types of exceptions should be thrown for invalid or unexpected parameters in .NET? When would I choose on

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
54 votes
5 answers
1.2K views
Which is generally best to use -- StringComparison.OrdinalIgnoreCase or StringComparison.InvariantCultureIgnoreCase?

I have some code like this: If key.Equals("search", StringComparison.OrdinalIgnoreCase) Then DoSomething(

avatar
User demo
0 1 0 9
asked 07 September, 2021
57 votes
15 answers
3K views
Is there a way to navigate to real implementation of method behind an interface?

In Visual Studio, when you right-click a method call, you go to the implementation of that method inside a cla

avatar
Thurman
0 1 0 9
asked 07 September, 2021
69 votes
5 answers
2.7K views
.NET Global exception handler in console application

Question: I want to define a global exception handler for unhandled exceptions in my console application. In a

avatar
Clarice
0 1 0 9
asked 07 September, 2021
58 votes
3 answers
878 views
Visual Studio jump to next error shortcut?

When a compile fails in VB.NET in Visual Studio 2008, an Error List pops up at the bottom of the screen. To ju

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
62 votes
21 answers
2.6K views
Why is there no ForEach extension method on IEnumerable?

Inspired by another question asking about the missing Zip function: Why is there no ForEach extension method o

avatar
Ali
0 1 0 9
asked 07 September, 2021
58 votes
4 answers
1.5K views
Is there a conditional ternary operator in VB.NET?

In Perl (and other languages) a conditional ternary operator can be expressed like this: my $foo = $bar == $b

avatar
Lynette
0 1 0 9
asked 07 September, 2021
57 votes
18 answers
347 views
Updating to latest version of CocoaPods?

I'm having some issues installing Alamofire 4.0 into my project. I've got the latest version of Xcod

avatar
Jeff
0 1 0 9
asked 07 September, 2021
53 votes
25 answers
1.1K views
How can I change image tintColor in iOS and WatchKit

I have an UIImageView called "theImageView", with UIImage in a single color (transparent background) just like

avatar
Don
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
2.8K views
Close iOS Keyboard by touching anywhere using Swift

I have been looking all over for this but I can't seem to find it. I know how to dismiss the keyboard us

avatar
Denese
0 1 0 9
asked 07 September, 2021
64 votes
12 answers
1.8K views
What does "Fatal error: Unexpectedly found nil while unwrapping an Optional value" mean?

My Swift program is crashing with EXC_BAD_INSTRUCTION and one of the following similar errors. What does this

avatar
Alba
0 1 0 9
asked 07 September, 2021
71 votes
9 answers
2K views
Static vs class functions/variables in Swift classes?

The following code compiles in Swift 1.2: class myClass { static func myMethod1() { } class func

avatar
Stacia
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.6K views
Get nth character of a string in Swift programming language

How can I get the nth character of a string? I tried bracket([]) accessor with no luck. var string = "Hello,

avatar
Corrin
0 1 0 9
asked 07 September, 2021
55 votes
29 answers
806 views
How to determine the current iPhone/device model?

Is there a way to get the device model name (iPhone 4S, iPhone 5, iPhone 5S, etc) in Swift? I know there is a

avatar
Basil
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
715 views
How do I get the App version and build number using Swift?

I have an IOS app with an Azure back-end, and would like to log certain events, like logins and which versions

avatar
Dwain
0 1 0 9
asked 07 September, 2021
51 votes
30 answers
2.3K views
Loading/Downloading image from URL on Swift

I'd like to load an image from a URL in my application, so I first tried with Objective-C and it worked,

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.6K views
How to hide UINavigationBar 1px bottom line

I have an app that sometimes needs its navigation bar to blend in with the content. Does anyone know how to

avatar
Corey
0 1 0 9
asked 07 September, 2021
55 votes
10 answers
1.2K views
Why create "Implicitly Unwrapped Optionals", since that implies you know there's a value?

Why would you create a "Implicitly Unwrapped Optional" vs creating just a regular variable or constant? If you

avatar
Lawanda
0 1 0 9
asked 07 September, 2021
49 votes
19 answers
1K views
How to add constraints programmatically using Swift

I'm trying to figure this out since last week without going any step further. Ok, so I need to apply some

avatar
Corrin
0 1 0 9
asked 07 September, 2021