Passing properties by reference in C#

I’m trying to do do the following: GetString( inputString, ref Client.WorkPhone) private void GetString(string inValue, ref string outValue) { if (!string.IsNullOrEmpty(inValue)) { outValue = inValue; } } This is giving me a compile error. I think its pretty clear what I’m trying to achieve. Basically I want GetString to copy the contents of an input … Read more

Semantic Issue: Property’s synthesized getter follows Cocoa naming convention for returning ‘owned’ objects

I’m currently using the iOS 5 SDK trying to develop my app. I’m trying to make an NSString a property, and then to synthesize it in the .m file (I have done this before with no issues). Now, I came across this: “Semantic Issue: Property’s synthesized getter follows Cocoa naming convention for returning ‘owned’ objects.” … Read more

Property ‘value’ does not exist on type ‘EventTarget’

I am using TypeScript Version 2 for an Angular 2 component code. I am getting error “Property ‘value’ does not exist on type ‘EventTarget’” for below code, what could be the solution. Thanks! e.target.value.match(/\S+/g) || []).length import { Component, EventEmitter, Output } from ‘@angular/core’; @Component({ selector: ‘text-editor’, template: ` <textarea (keyup)=”emitWordCount($event)”></textarea> ` }) export class … Read more

Are there any reasons to use private properties in C#?

I just realized that the C# property construct can also be used with a private access modifier: private string Password { get; set; } Although this is technically interesting, I can’t imagine when I would use it since a private field involves even less ceremony: private string _password; and I can’t imagine when I would … Read more

react-router – pass props to handler component

I have the following structure for my React.js application using React Router: var Dashboard = require(‘./Dashboard’); var Comments = require(‘./Comments’); var Index = React.createClass({ render: function () { return ( <div> <header>Some header</header> <RouteHandler /> </div> ); } }); var routes = ( <Route path=”https://stackoverflow.com/” handler={Index}> <Route path=”comments” handler={Comments}/> <DefaultRoute handler={Dashboard}/> </Route> ); ReactRouter.run(routes, function … Read more

Objective-C ARC: strong vs retain and weak vs assign

There are two new memory management attributes for properties introduced by ARC, strong and weak. Apart from copy, which is obviously something completely different, are there any differences between strong vs retain and weak vs assign? From my understanding, the only difference here is that weak will assign nil to the pointer, while assign won’t, … Read more