object

fast enumeration on NSDictionary fails with "[Waypoint countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance ..."

Hello, I have my data in a NSDictionary object where the keys are CGPoints converted to NSValues and the objects are UIColors. Here's the method I'm using to return an object from the dictionary: - (UIColor*) getTemperatureColor2 { NSDictionary* temperatureColorMap = [Weather getTemperatureColorMap]; for(id key in temperatu...

General Objective-C Class method question

I have an iPhone application which has some methods to gather information from the web and which then creates an object, which holds this information as properties (lets say I'll get objects of type x). Since I might need those kind of objects from various points within the application, I put the method to create one instance of the obje...

How to pull a string out from NSUserDefaults

Alright, I have my code, and I believe I have narrowed down the crashing bug to one section. Upon the view loading, my code loads the NSUserDefaults and pulls the string out of them. It then works with teh string. The problem is, I'm not sure how to pull the string out. Here is the relative code: NSUserDefaults *prefs = [NSUserDefau...

Set <object>'s contentDocument from another DOM

I need to insert a DOM which is a complete SVG document into an <object> element. SO here's my code: var svgDom = (new DOMParser()).parseFromString(streamedFile,'image/svg+xml'); var pagePics = document.querySelectorAll('#currentFiles figure object'); for (var i=0; i<pagePics.length; i++){ pagePics[i].contentDocument = svgDom.doc...

What property is alert showing me?

Hi When I am writing Javascript, I use window.alert() to debug. Usually I pass variables to alert and it pops up with a string containing that variables value. However, if I pass alert an object, it tells me the type of the object. For example: var form = document.getElementById("my_form"); alert(form); // returns [object HTMLFormEleme...

Can plain Javascript objects have events?

Can plain Javascript objects have event attached to them? Say something like this: obj = new Object(); obj.addEventListener('doSomething', foo, true); I know i can do this with jQuery, but is it possible without any library? ...

Using object in the jQuery post parameter

I'm thinking this is not possible but I would like some insight as to why. I want to do something like this: var pVals = { ob1: "postvar1", ob2: "postvar2", ob3: "postvar2" }; $.post("php/dosomething.php",{pVals.ob1:"object 1", pVals.ob2:"object 2", pVals.ob3:"object 3"}); I get an error along the lines of: missing : ...

MS Access : Determine Object Type

Is there a way to determine the Object type, when passing a reference to a function? I'm using a security permissions function, which determines if the user has permission to view/edit the Form passed to it by reference. I'd like to expand this to include reports as well. To keep the function generic, I'd like to pass a ref for either ...

Why can't we create objects for an abstract class in C++?

I know it is not allowed in C++, but why? What if it was allowed, what would the problems be? ...

Does new() allocate memory for the functions of a class also?

class Animal { public: int a; double d; int f(){ return 25;} }; Suppose for the code above, I try to initialize an object, by saying new Animal(), does this new() also allocate memory for the function f()? In other words, what is the difference in memory allocation terms if I had this class instead and did a new Animal() ? : c...

Compressing Object in Dot Net

Hi, I want to Compress an Object in dot net to reduce its size and then UnCompress it on in my client application. Thanks, Mrinal Jaiswal ...

XAML foreach() Error Object reference not set to an instance of an object.

I have a strange XAML Error that comes up in Visual Studio. I have Isolated it to the code below which causes it. The XAML designer errors when the converter below is used, however the application runs just fine without error. I like to keep the code tidy and remove all warnings and errors, what do I need to do to get rid of this one? ...

Which of these statements about objects is true?

Given this: struct { int x; } ix; struct A { A() {}; int x; }; A ia; Which of these is true? a. ix is an object b. ia is an object c. both are objects d. both are not objects. ...

XNA mouse coords vs objects problem

Hi all, I'm having a problem with the xna framework, I have a stripped down version of my code here to demonstrate. When the mouse is clicked an object is created at that mouse click point and the object is displayed via it's own draw method. What happens is that the first object is created at the correct position (current mouse coords...

checking for a null object in C++

Hi all, I've mostly only worked with C, and am running into some unfamiliar issues in C++. Let's say that I have some function like this in C, which would be very typical: int some_c_function(const char* var) { if (var == NULL) { /* exit early so we don't dereference a null pointer */ } /* rest of code */ } and l...

Subtype Supertype with Oracle Object Type Creation. Limit on the number of subtypes?

I have run into an issue when creating a object type in Oracle 10g that inherits from a supertype. We currently have many object types that inherit from this supertype and recently the compiler started throwing the following errors ORA-30745: error occured while trying to add column "SYS_NC_ROWINFO$" in table "DATA_CACHE.CACHE_ENTRIES" ...

Does Prototype's Array.compact() filter recursively for multidimensional arrays?

I'm just wondering if Prototype's helper functions Array.compact() and Array.without() filter for multidimensional arrays. It doesn't look like it, and if so, was there a reason for this or is there another helper function in Prototype that does this? ...

C# .NET object disposal

Should be an easy one. Let's say I have the following code: void Method() { AnotherMethod(new MyClass()); } void AnotherMethod(MyClass obj) { Console.WriteLine(obj.ToString()); } If I call "Method()", what happens to the MyClass object that was created in the process? Does it still exist in the stack after the call, even thou...

Allowing Arbritary Embeds / Javascript

Hello, I'm playing with ways to allow users to insert embedded objects safely into content. What I'm doing now is essentially the following: 1) parser for youtube embed code 2) get video id, remove all other embed code 3) rebuild youtube embed code with video id This seems to work pretty well, and should be safe. Problem, I'd essent...

Object equality in .NET

I feel pretty ignorant asking this, but would someone be able to explain to me why this is happening? class MyClass{ public int i {get; set; } } class Program { static void Main(string[] args) { MyClass a = new MyClass(); MyClass b = new MyClass(); b.i = 2; a = b; a.i = 1; ...