I can't see anywhere that this should be the case, but I get an "Invalid declaration syntax" error in the get everytime I declare a static property that does not start with an uppercase letter. E.g:
type Foo() = class
static member bar
with get() = "bar" //Invalid declaration syntax in get
end
...
I've been sort of on the fence on this one for a while, but I'd like to know what people think about accessing instance variables directly from within an Objective-C class implementation?
Using accessors and mutators makes a lot of things easy, but for simple things, is it bad to access the instance variable directly? Is the best practi...
I've noticed that some of Apple's examples include both a retain and readonly modifier on properties. What's the point of including retain if no setter gets generated when we're using the readonly modifier?
Example: @property (retain, readonly) NSString *title; from the AnimatedTableView sample.
...
Sorry I couldn't give a more descriptive title. My question (after looking at the code below) is what statusText is. Is it an IBOutlet or a UILabel? How does "@property (retain,nonatomic) UILabel *statusText" work? Does that statement mean that statusText is a property???
Thanks for answering. If there are any questions, please feel fre...
Hi, I'm a beginner following a book for creating iPhone apps.
One of the steps was writing "UISwitch *whichSwitch = whichSwitch.isOn;" and I was just curious as to where "isOn" came from?
In the documentation:
on
A Boolean value that determines the off/on state of the switch.
@property(nonatomic, getter=isOn) BOOL on
What does that...
I'm trying to convert an existing (non-LINQ to SQL) class into a LINQ to SQL entity class which has an existing (db column) property like:
public string MyString
{
get { return myString; }
set { myString = FormatMyString(value); }
}
Is there a way to do this sort of processing on the value of entity class property before savin...
Is there a special XML element for name/value property pairs like the following, something that I can leverage in C# code?
<Properties>
<Property>
<Name>xyz</Name>
<Value>abc</Value>
</Property>
</Properties>
...
Hi, all.
My spaghetti monster consumes XML from several different SOAP services, and the URL for each service is hardcoded into the application. I'm in the process of undoing this hardcoding, and storing the URLs in a properties file.
In terms of reading the properties file, I'd like to encompass that logic in a Singleton that can be ...
I ran across this segment of code (in .m implementation file in an IBAction instance method):
UIActionSheet *actionSheet = [[UIActionSheet alloc] ...];
...
[actionSheet showInView:self.view];
self refers to the button but I wanted to know where I could find out about this "view" property since I looked up UIButton, UIView, NSObject, b...
XAML: What is the functional difference between the following notations?
Is there any reason I shouldn't use the first method for properties?
<Setter Property="Shape.Stroke" TargetName="circle" Value="#FF3C7FB1"/>
<Setter Property="Shape.Stroke" TargetName="arrow">
<Setter.Value>
<SolidColorBrush>#FF222222</SolidColorBrush>
<...
Public class ClassB : ClassA
{
}
public class GeneralClass
{
public ClassA test
{
get{}
set{}
}
}
public class specificClass :GeneralClass
{
public ClassB test
{
get{}
set{}
}
}
As you can see the property test is inherited in specificClass from generalClass but here I want to change the type ...
If I have a "fake" Visual C++ property:
int _declspec( property( get = GetFoo ) ) Foo;
int GetFoo() const { ... }
Is there any way to get the debugger to evaluate this and display it as a normal member variable in the QuickWatch window?
...
In C# do properties need to reference private member variables, or can I just declare the properties and use them directly in the class code?
If the former is the best practice, then does that rule out using C# property short-hand? I.e.
public string FirstName { get; set; }
...
I'm using Jboss 4/5 and have some .war .properties files with default configuration settings
I want to update these settings using information from the windows xp environment variables.
${env} in ant
...
I have a property-file with strings inside, formatted in this way:
audit.log.events.purged=The audit events were purged. {0} events were purged, {1} assets were deleted.
Is there a way to bind some values inside those {0} and {1}, using some standard APIs, or should I create some code for parsing those Strings?
...
Hi all,
Sorry If I am being noob, I have this doubt, why do we use private variables and set them using properties ?
Why can't we just use properites alone ?
I am talking about situations like this
private string _testVariable;
public string MyProperty
{
get { return _testVariable;}
set {_testVariable = value;}
}
I am thi...
For my current project I want to integrate a maven plug-in for database migrations. For this plug-in to work, however, I have to obtain the database settings inside my POM. My database settings are currently placed inside a hibernate.properties file, positioned in a directory that is marked as maven resource. For a variety of reasons I d...
Hi All,
I am using c# & .NET 3.5. A vendor gives us an object that has properties of UserVarNbr1, UserVarData1, UserVarNbr2, UserVarData2,... UserVarNbrN, UserVarDataN. Not the way I would have coded it but nonetheless, this is what we have to work with. Another object in the application returns a collection of items used to represent th...
I have a UILabel called optionsDisplayerBrushSizeLabel who's text property I want to set to a CGFloat: brushSizeVal. I understand that the text property needs to be a string but I don't know how to convert a CGFloat to an NSString.
...
I'm in a mess with visibility between classes. Please, help me with this newbie question.
I have two controls (DatePickers from default WPF toolbox) which are in different windows, so in different classes. I can easily access these controls properties like datePicker1.Text from within its native class, i.e. in its native window, but whe...