It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I would like to know when a particular property is accessed (set or get). I know that with symbolic breakpoint i can know when a method or function is being called... is it applicable for properties?
#Vladimir & pedro.m:
I tried your answer, but it seems like nothing happens:
Yes, properties are actually just shortcuts that define setter and getter methods for you.
Use symbolic breakpoints to know when they get accessed:
Yes, as properties are just a syntactic sugar for calling accessor methods you can set symbolic breakpoints to them. If you want to track both setter and getter calls you will need 2 breakpoints: for -property and -setProperty: methods.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
What is protocol? How can we define it in iOS?
A protocol is an agreed set of methods that are implemented by a class, when that class states it adheres to that protocol.
Those methods might be optional or required, this is set in the protocol definition.
Best course is to look here (requires sign in) and indeed read the whole of this guide as it a good starting point to understanding underlying design patterns in cocoa and objective-c.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Why using NSNotificationCenter(ios) in a mobile apps. I mean I dont have many UI controls to update on a View. Also if I need to pass down to the caller of a View I would just use a delegate.
It might be justifiable in a logical sense if I have many Views in a Navigation control, and I would like to have each view down the navigation to update something - it is in situations like this NSNotificationCenter gets into play?
Thanks
Regards
In the situations you mention, you probably shouldn't use notifications -- it really doesn't have anything to do with mobile apps, the same criteria would apply to desktop apps as well. Notifications are best used if you need multiple objects to listen for an event, or in some cases, where two view controllers are far apart in the overall scheme of controllers, it's difficult to have one view controller set itself as the delegate of the other.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I creat a instance of a class. Can I use some method to get the variable name, then I print out it? I just want this when I do some test project. I think I really mean is the variable name.
Unfortunately, no, you can't.
Object instances don't have names. Classes have names. Methods have names. Properties have names. But object instances don't. Variables have names, but they're not unique to instances, and you don't have access to that programmatically, anyway.
If you just invoke the description method, you'll generally get a little something to identify the instance, but it's not a name.
UIView objects have a numeric tag property, so for those you can set that property and identify your controls that way.
property_getAttributes is part of the Objective-C runtime, as described here http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008048-CH1-SW1.
If you want to gain some kind of introspection about ObjC classes, it is the way to go. I don't think this is unstable, since the Objective-C runtime itself is quite stable. Furthermore there is an official guide (see link above) so you can trust it to be as stable as any other official Apple API.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am new to Knockout Js..I have this issue on my page that when one dependent observable is getting executed, an unrelated dependent observable also gets executed.
Is this a normal behavior or am I doing something wrong?
Only related dependent observables should be executed.
Knockout.js will retrieve the initial value of the dependent observable and it will monitor what obervables were accessed. Then it will subscribe to those observables to detect future changes.
If a observable changes that is not related to your dependent observable then it shouldn't be executed.
See: How dependency tracking works.
If you want further help then include an code example. Also make sure you are running the latest Knockout.js version with bug fixes, etc.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Anyone done this in MVC? any info would be great!.
Thanks.
You can get pretty far simply by including a print.css file for media type print.
Hide everything you don't want and include logical page breaks and demensions (inches, etc... actually format more correctly using the print.css override).
I have used a custom controller (or filter) to handle links using something like index.print instead of index.html, which simply overrides the master layout with a layout more suitable for printing, but I still feel that the alternate stylesheet is the best way to go.
http://www.alistapart.com/articles/goingtoprint/
Printing a page isn't really a matter for ASP .NET or MVC. Printing is a client-side operation, and therefore can (and should) be done entirely in client-side code. JavaScript has a method call for this:
window.print()