Tag: r

55 votes
23 answers
2.9K views
@selector() in Swift?

I'm trying to create an NSTimer in Swift but I'm having some trouble. NSTimer(timeInterval: 1, targ

avatar
Majorie
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.9K views
Split a String into an array in Swift?

Say I have a string here: var fullName: String = "First Last" I want to split the string base on white spac

avatar
Sena
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
2.5K views
Get the length of a String

How do you get the length of a String? For example, I have a variable defined like: var test1: String = "Scot

avatar
Forrest
0 1 0 9
asked 07 September, 2021
51 votes
17 answers
2.4K views
#ifdef replacement in the Swift language

In C/C++/Objective C you can define a macro using compiler preprocessors. Moreover, you can include/exclude so

avatar
Rufus
0 1 0 9
asked 07 September, 2021
56 votes
16 answers
1.2K views
How to iterate a loop with index and element in Swift

Is there a function that I can use to iterate over an array and have both index and element, like Python'

avatar
Keith
0 1 0 9
asked 07 September, 2021
51 votes
9 answers
2.8K views
Swift Beta performance: sorting arrays

I was implementing an algorithm in Swift Beta and noticed that the performance was very poor. After digging de

avatar
Basil
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.2K views
How to change Status Bar text color in iOS

My application has a dark background, but in iOS 7 the status bar became transparent. So I can't see anyt

avatar
Bryan
0 1 0 9
asked 07 September, 2021
52 votes
30 answers
738 views
Passing data between view controllers

I'm new to iOS and Objective-C and the whole MVC paradigm and I'm stuck with the following: I have a

avatar
Vi
0 1 0 9
asked 07 September, 2021
56 votes
28 answers
1.4K views
How can I print a circular structure in a JSON-like format?

I have a big object I want to convert to JSON and send. However it has circular structure. I want to toss what

avatar
Forrest
0 1 0 9
asked 07 September, 2021
61 votes
22 answers
3.1K views
How do I convert an existing callback API to promises?

I want to work with promises but I have a callback API in a format like: 1. DOM load or other one time event:

avatar
Nereida
0 1 0 9
asked 07 September, 2021
55 votes
24 answers
1.7K views
module.exports vs exports in Node.js

I've found the following contract in a Node.js module: module.exports = exports = nano = function databas

avatar
Scot
0 1 0 9
asked 07 September, 2021
60 votes
11 answers
2.9K views
Node.js Best Practice Exception Handling

I just started trying out node.js a few days ago. I've realized that the Node is terminated whenever I ha

avatar
Omar
0 1 0 9
asked 07 September, 2021
65 votes
15 answers
1.3K views
How to list npm user-installed packages?

How do I list the user-installed package ONLY in npm? When I do npm -g list it outputs every package and their

avatar
Dario
0 1 0 9
asked 07 September, 2021
56 votes
25 answers
2K views
Upgrade Node.js to the latest version on Mac OS

Currently I am using Node.js v0.6.16 on Mac OS X 10.7.4. Now I want to upgrade it to the latest Node.js v0.8.1

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
65 votes
23 answers
2.1K views
How to access POST form fields

Here is my simple form: <form id="loginformA" action="userlogin" method="post"> <div>

avatar
Kisha
0 1 0 9
asked 07 September, 2021
62 votes
30 answers
707 views
Upgrading Node.js to latest version

So, I have Node.js installed and now when I tried to install Mongoosejs I got an error telling me that I don&a

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
58 votes
11 answers
2.4K views
npm WARN package.json: No repository field

I installed Express.js with the following command: sudo npm install -g express I get the following warnings

avatar
Solomon
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
1K views
Error: Can&apos;t set headers after they are sent to the client

I'm fairly new to Node.js and I am having some issues. I am using Node.js 4.10 and Express 2.4.3. When

avatar
Eddie
0 1 0 9
asked 07 September, 2021
60 votes
21 answers
921 views
How is an HTTP POST request made in node.js?

How can I make an outbound HTTP POST request, with data, in node.js?

avatar
Bryan
0 1 0 9
asked 07 September, 2021
61 votes
17 answers
2.7K views
Sending command line arguments to npm script

The scripts portion of my package.json currently looks like this: "scripts": { "start": "node ./script.js

avatar
Kurtis
0 1 0 9
asked 07 September, 2021