I have a ViewController and add programmatically a subview.
During the initialization of the subview (initWithFrame) i want to set some attributes to values according to attributes that belong to another ViewControllers Child-Object (not a view).
-(id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
// The following is kind of what i want
self.myAttribute = [self.viewController.otherObject otherValue];
}
return self;
}
Thanks in advance for any answers and comments how to improve the question.
Frank
In all the MonoTouch examples I have seen everyone is using outlets and actions on AppDelegate, yet when I've been through some objective-C webcasts I see people using an Object they drag onto XIB in Interface Builder and using that (Seems a lot cleaner). Is there just not a way to reference any Objects like that that we create? Is there a particular way to access it?
Any advice would be appreciated,
thanks
Based on my understanding SerializableAttribute provides no compile time checks, as its all done at runtime, then why is it required for classes to be marked as serializable?
Couldn't sterilizer just try to serialize an object and just fail? isn't it what it does right-now when something is marked, it tries and fails. wouldn't it be better if you had to mark things as unserializable rather than serializable? that way you wouldn't have the problem of libraries not marking things as serializable?
i have the following two class which convert object into xml string
should i do something like
class Person
{
public string GetXml()
{
//return a xml string
}
}
or it is better to create another class which accept the person as a parameter
and convert it into XML something like
class PersonSerializer
{
public string Serialize(Person person)
{
// return a xml string
}
}
Thanks
I would like to know the best Practice that you guys follow when it comes to access the SharePoint List Items / Doc Lib using Object Model. To start let me share few things I have found.
Limit the number of Items Per container to 2K items.
Use ProcessWebData method of SPWeb to do Update/Insert of Large items
I know this is very evil, but is it possible to add an object to another module's globals, something like:
#module dog.py
import cat
cat.globals.addVar('name','mittens')
and
#module cat.py
print name #mittens
I'm just getting started in Visual Studio 2010 and I'm coming from Delphi 7.
In Visual Studio 2010, what is the equivalent to Delphi's Object TreeView?
Or to ask it another way, in Visual Studio 2010, during WinForm Gui development, how do you navigate your Gui hierarchically? If I have, say, a bunch of Panels with some of them inside of others and some Docked to Client, how can I directly select a specific Panel?
Is there any way I can repair my repository with commit history in tact.
# git log
fatal: object 01aeb2bf2e93b238f0e0422816b3e55518321ae7 is corrupted
From reading the link below it looks like I'll have zap it and start over.
http://www.miek.nl/s/7e76eadefe/
hello:
i have just created a new empty website from visualstudio 2010, added an new webform and droped a login control into the page.when i click the tag "administer website" then try to open security-Use the security Setup Wizard to configure security step by step, the IE8 shows the error: "Object Expected".
(tried to make a asp.net site with generated code, without any modification, but the error still occered)script type="text/javascript"
Is it possible to loop through a data() object?
Suppose this is my code:
$('#mydiv').data('bar','lorem');
$('#mydiv').data('foo','ipsum');
$('#mydiv').data('cam','dolores');
How do I loop through this? Can each() be used for this?
I have an piece of html in a jquery object. When I say $(this).html() I get:
<span class="value">4</span><span class="type">teaspoons</span>butter
I want to get only the piece of text from this html segment that is not in the spans. in this example, it is butter.
How do I get that?
Thanks!
I would like to be able to add a click event to a entity generated in the code behind. Currently I'm doing it like this:
TableRow row = new TableRow();
row.Attributes.Add("onclick", "clickFunction(this)");
Is there a way to do this using the object initializer? I am doing a lot of control creation/initialization and if it matched the rest of the code it would be nice
Hi,
1) What is difference in thers two statements:
String s1 = "abc";
and
String s1 = new String("abc")
2) as i am not using new in first statement, how string object will be created
Thanks
{"names": [
{"patientName": "Ratna"},
{"patientName": "raju" },
{"patientName": "krishna"},
{"patientName": "kishore"},
{"patientName": "Kishore1"},
{"patientName": "mahesh"}
]}
this is the JSON object i'm getting from Ajax call
so now i want to add all patientName values to select box through jquery
can any one tell me how to accomplish this ??
here i'm using $.ajax() function for ajax call
thanks in advance
Hi,
How can i set an image to a circular slider, which is an object of NSSlider. I have called setImage: method, but does not work out. What could be the alternative approach to do so.
i like to drag this object vertically instead of horizontally, which is doin it now:
(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
if (CGRectContainsPoint(myObject.frame, location)){
CGPoint xLocation = CGPointMake(location.x, myObject.center.y);
myObject.center = xLocation;
}
}
Hi Everyone,
I'm specifically using the Google Contacts API at the moment, but this could be true of other scinarios as well.
I have the following code:
Contact newContact = new Contact();
When I let the code run without any breakpoints, I get a NullReferenceException on all of the properties of this object. However, if I put a breakpoint just after this line, I can see all of the properties have been initialises and the rest of my code executes fine.
Any idea's would be greatly appreciated
So I've been reading through the book PHP Solutions, Dynamic Web Design Made Easy by David Powers. I read through the short section on Object Oriented PHP, and I am having a hard time grasping the idea of the - operator. Can anyone try to give me a solid explanation on the - operator in OOP PHP?
Example:
$westcost = new DateTimeZone('America/Los_Angeles');
$now->setTimezone($westcoast);
Also,a more general example:
$someObject->propertyName
Thanks
when i connect to database by ado.net. As for sqlconnection object, it has a function:BeginTransaction with 3overload. I dont know how to use it and what's its function for? Help me plz!
i.e. would cause the object to be released immediately and not have to be released by the pool if I did this?
[[NSArray arrayWithCapacity:100] release];
Can't find a clear explanation in the docs about this.
I got script what read from database and manipulate it so on the end I got $result array...
on one server
is it possible to serialize this object and pass it to other script so this $result array could be available for other script on second server...
I got on first server:
return serialize ( $results );
and on second:
$data = unserialize ( file_get_contents ( 'http://www.......com/reader.php' ) );
...but there is no communication between ....
What I am doing wrong ?
Bensiu
How can I get the session from within a command object?
I have tried:
import org.springframework.security.context.SecurityContextHolder as SCH
class MyCommand {
def session = RCH.currentRequestAttributes().getSession()
}
This throws
java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.