hi, i have a tableview application loaded with core data feltching objects and i wanna know if it is possible to reset the table with a simple button. Thanks
code to add an object :
NSManagedObjectContext *context = [fetchedResultsController managedObjectContext];
NSEntityDescription *entity = [[fetchedResultsController fetchReque...
Closures are poor man's objects and vice versa.
I have seen this statement at many places on the web (including SO) but I don't quite understand what it means. Could someone please explain what it exactly means?
If possible, please include examples in your answer.
Thanks.
...
SOLVED:
This is what was wrong:
current.addFolder(folder); (in the final else clause of the if statement)
Added a new folder, but did not guarantee that the folder passed is the folder added, it may simply do nothing if the folder already exists, so to overcome this I changed addFolder to return the actual folder (for example if ...
Hi guys,
I am new to ninject, I am wondering how I can run custom initizlisation code when constructing the injected objects? ie. I have a Sword class which implements IWeapon, but I want to pass an hit point value to the Sword class constructor, how do I achieve that? Do I need to write my own provider?
A minor question, IKernel kerne...
I'm coming from a background in ColdFusion, and finally moving onto something modern, so please bear with me.
I'm running into a problem casting objects. I have two database tables that I'm using as Models - Residential and Commercial. Both of them share the majority of their fields, though each has a few unique fields. I've create...
config.ini:
[globalloads]
plugin.SWPlugin = 1
plugin.SWPlugin.params.1 = true
plugin.SWPlugin.params.2 = 10
[testz : globballoads]
plugin.SWPlugin.params.2 = 20
plugin.SWAnotherPlugin = 1
Simple enough?
// load testz config and programmatically create this equivalent code:
SWPluginAbstract p = new SWPlugin(true, 20);
// go thru the ...
Hi all,
I am trying to maintain my session variables that I get back in a cookie from my website in my DefaultHttpClient by passing the client between activities. Simply put how can I pass this object between activities to maintain my session variables? Bundle.put... doesn't seem to support this object. If it does how does it work wi...
Hey guys, I'm trying to add a textfield.text entry to an array. I want to pull the textfield.text from a text field in another view. Here's my code.
- (void)addBookmark{
MultiViewViewController *mainView = [[MultiViewViewController alloc] init];
if (mainView.addressTextField.text.length>1) {
NSString *addedString = [[NSString alloc] ...
I'm just getting my head round C#. I've been creating classes and objects so say i created a class called Member:
public class Member
{
public int MemberID;
public string FirstName;
public string LastName;
public string UserName;
}
and I create a new object of that class by doing this:
Member Billy = new Me...
I am getting ready to take a class at a college on C#. I have been reading up on it a lot and decided to start a fun project.
Here is what my project consists of:
Main Control Form
Configuration Form
Arduino
Program.cs calls Configuration.cs at start. This is where pin modes for the Arduino are set and where a timer is set. ...
I have a simple program which can have an admin user or just a normal user.
The program also has two classes: for UserAccount and AdminAccount.
The things an admin will need to do (use cases) include Add_Account, Remove_Account, and so on.
My question is, should I try to encapsulate these use-cases into the objects?
Only someone who is...
Say I have a simple object such as
class Something
{
public int SomeInt { get; set; }
}
I have read that using immutable objects are faster and a better means of using business objects? If this is so, should i strive to make all my objects as such:
class ImmutableSomething
{
public int SomeInt { get { return m_someInt; } }
p...
Hi, guys!
I know how to decode a JSON string with one object with your help from this example http://stackoverflow.com/questions/2543389/how-to-decode-a-json-string
But now I would like to improve decoding JSON string with several objects and I can't understand how to do it.
Here is an example:
{ "inbox": [
{ "firstName": "Brett", ...
Hello,
I have two websites that have an almost identical database schema. the only difference is that some tables in one website have 1 or 2 extra fields that the other and vice versa.
I wanted to the same Database Access layer classes to will manipulate both websites.
What can be a good design pattern that can be used to handle that ...
Hello,
I have a constructor that looks like this (in c++):
Interpreter::Interpreter() {
tempDat == new DataObject();
tempDat->clear();
}
the constructor of dataObject does absolutely nothing, and clear does this:
bool DataObject::clear() {
//clear the object
if (current_max_id > 0) {
inde...
I work on a large application, and frequently use WinDbg to diagnose issues based on a DMP file from a customer. I have written a few small extensions for WinDbg that have proved very useful for pulling bits of information out of DMP files. In my extension code I find myself dereferencing c++ class objects in the same way, over and ove...
I have a class named Storage. Storage contains an arraylist of special objects called Products. Each product contains information such as name, price, etc. My code is as follows:
class Storage{
Product sprite = new Product("sprite",1.25,30);
Product pepsi = new Product("pepsi",1.85,45);
Product orange = new Product("orange",2.25,...
I have a very simple JSON array (please focus on "points.bean.pointsBase" object):
var mydata =
{"list":
[
{"points.bean.pointsBase":
[
{"time": 2000, "caption":"caption text", duration: 5000},
{"time": 6000, "caption":"caption text", duration: 3000}
]
}
]
};
// Usually we ...
So I have a class that has the following member variables. I have get and set functions for every piece of data in this class.
public class NavigationMesh
{
public Vector3 node;
int weight;
bool isWall;
bool hasTreasure;
public NavigationMesh(int x, int y, int z, bool setWall, bool setTreasure)
{
//defau...
I've got a handmade ORM in PHP that seems to be bumping up against an object limit and causing php to crash. Here's a simple script that will cause crashes:
<?
class Bob
{
protected $parent;
public function Bob($parent)
{
$this->parent = $parent;
}
public function __toString()
{
if($this->paren...