[AC-3239] Data binding to TableViewRow title property requires string data type
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-02-06T23:17:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy |
Labels | n/a |
Reporter | Andrew Church |
Assignee | Shak Hossain |
Created | 2013-02-06T14:55:27.000+0000 |
Updated | 2016-03-08T07:57:39.000+0000 |
Description
When configuring data binding for a TableView, if binding the "title" property on a TableViewRow to a model property, and the model's property is not a string, an argument exception is thrown and the application crashes. I would think that the proxy should accept values not of string type and just convert them.
[ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
Reason:
-[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xb23fce0
Stack trace:
0 CoreFoundation 0x03587012 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x02fd9e7e objc_exception_throw + 44
2 CoreFoundation 0x036124bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 253
3 CoreFoundation 0x03576bbc ___forwarding___ + 588
4 CoreFoundation 0x0357694e _CF_forwarding_prep_0 + 14
5 UIKit 0x00f2ee9f -[UILabel _setText:] + 92
6 UIKit 0x00f2f064 -[UILabel setText:] + 40
What other data types would you like to be able to be inserted in the title property? The title property of TableViewRow is only meant to show a title in the form of a string which describes what the Row is. If you want to have any other thing inside the row you can just add to it (such as a view or label). Would you mind elaborating on the benefits of allowing any data type be in the title property? Regards, Carter
This is expected behavior. **title** is a string property.