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.
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.
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.
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.
Strange grammar, but I want to ask if there are cases where if I don't KVO (Key Value Observation), the app just can't do certain things/features?
Thanks
Key Value Observing offers functionality and behaviors that are unique and certainly useful to a developer, in same cases offering a glimpse at values that are otherwise opaque.
For example, if you want to know the precise duration of an animation in Cocoa that is otherwise a black-box (for example, the keyboard disclosure animation duration), KVO is the only way I know of that you could establish that.
Beyond that, it's a useful pattern for programming applications that involve data (go figure). As such, it is yet another tool in a developer's toolkit.
Can you get by without it? Sure. There are many tools you can get by without, and this one takes a little bit of effort to wrap your head around initially. But should you make a point of avoiding it? No, I don't think so - why would you?
You nearly never need KVO.
Only when you need some special things, or want to circumvent Apple sw design.
And for that few cases, you will find demo code, so dont worry about KVO much.
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 am developing an app that allows users to post to walls/groups very much like facebook or a classic forum. I really like the way you can post a link on facebook and the link will be recognized as a video, pic, or other media and will automatically display. Its a great feature b/c it keeps users on facebook instead of leaving the site. On that note, I was looking to implement something similar for my the app I am developing. Are there any rails plugins/gems that do this kind of thing?
Yes, I know how to google and have done so. I realize that I could write regular expressions to scan the link and then take an according action. However, I am looking for an existing implementation to save a boat load of time.
Any and all input would be appreciated.
Existing implementations would probably be employing some form of regular expression, although another approach is using custom "Markdown" syntax or BB code to make the regular expression easier.
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 have a requirement where, I need to give the user only one editable java class where he can make changes in the program such as changing username, changing phone number. The moment he saves the data, the built program should be able to reproduce the changes.
I am doing this project for BlackBerry.
I want to know, is there any way in which I can link a class with external project? I am developing the project using Eclipse. I don't know how the user will make changes and save. I know it's a little weird but generally speaking, I want to link two different applications using some middle interface. Any help is greatly appreciated
I believe this is a simple case of "You think you know what you want but you really don't" :)
Please explain what it is you want to achieve between your two apps and how they interact and we will provide you with a much better solution than asking a user to modify java files.
UPDATE AFTER OP COMMENT :
You need to look at XML or JSON. These are ways to format data so that it is easy to write/produce/transfert/parse.
Parsing XML on Blackberry
Parse XML file on BlackBerry
When you build a java project you get a jar file. If you include that jar file into the classpath, all of its contents will be available to your code (with necessary import statements).
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 under a POSTGRESql database using the PosGis module and i need to access a database field from a Delphi application which is a GEOMETRY type field.
By Using a FieldByName('...').AsString, it creates me an error.
Is there a way to get this data in Text/String format from SQL or in Delphi please ?
Thanks
Gwenael
You can use PostgreSQL data type casting - SELECT ... <expression>::text ...
AFAIK there is no Delphi field type that could match, it is up to the middleware/driver used to access it to transform it into another datatype, or supply an ad-hoc class to implement the specific field behaviour. I guess the Delphi standard one doesn't - look for someone that does, or you may have to access the Postgres client API directly.