This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Customizing a model object's JSON representation, first of all, is a business of ActiveRecord::Serialization. You will look at ActiveModel::Serializers::JSON class | |
https://github.com/rails/rails/blob/master/activemodel/lib/active_model/serializers/json.rb | |
and then will come back to ActiveModel::Serialization class | |
https://github.com/rails/rails/blob/master/activemodel/lib/active_model/serialization.rb | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Do you know, you can access your own rails website on /rails/info/routes , under development environment? | |
The working house is shown below. | |
https://github.com/rails/rails/blob/master/railties/lib/rails/info_controller.rb | |
In turn, ActionDispatch::Routing::RoutesInspector is the real hero. Linked below. | |
https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/inspector.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIStory needs a Procedure to guide it, and story listens to Procedure's events of proceed and complete . | |
It is UIStory to expose proceedNext method for client to call. While UI will have "next" button to proceed the procedure, too. | |
UIStory has a JXUIVCFactory_ProcedureStep . | |
VCFactory will createVC, setObject:intoVC, and getObject:fromVC, according to step. | |
Since the kinds of steps are currently limited, the VC types to be used are limited too, therefore manually manageable. | |
JXModel_ProcedureStep_ObjectPart_Attribute --- JXUITVDSD_NSArray_Selection (or JXUITVDSD_NSArray_Selection__allowsAddSimpleTextOptions) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Filtering | |
NSPredicate | |
## Ordering/Sorting | |
NSSortDescriptor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Controller 和 Filter 互联方案 | |
以ControllerContext为中介,合理利用ViewData。 | |
http://msdn.microsoft.com/en-us/library/system.web.mvc.controllercontext(v=vs.108).aspx | |
自定义Model类: | |
UserIntention |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class_addIvar, in Objective-C runtime, is useless, because it does not support to add ivar in an EXISTING class. | |
https://developer.apple.com/library/ios/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html#//apple_ref/c/func/class_addIvar | |
You can use the concept of idInfo (see id-ego-superego), to add run-time generated objects' property. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return [self.object valueForKey: attrName]; | |
-- | |
SEL getterSEL = NSSelectorFromString( attrName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After 3 years of iOS development practice, finally I have chance to fully work with the soft keyboard. I found the Apple official docs is far from enough to deal with every cases of iOS soft keyboard. Then online 3rd party docs are helpful but not complete either. I can understand it since everyone is busy, very few people to write a complete guide for any specific topics. | |
Then I come to this. I have to do trial and error to grasp this piece of knowledge. One problem I was facing is when device is in landscape, you cannot use keyboard's height to adjust textview/tableview's contentInsets, since the height actually seems as its "width". UIWindow is mounted always in portrait mode, and keyboard frame goes with it. When device and UI is in landscape, the keyboard frame is still measured as it is in portrait. The solution: | |
CGRect frameEnd = [[notif.userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; | |
frameEnd = [self.view convertRect: frameEnd fromView: nil]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://svnbook.red-bean.com/en/1.0/index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is my sum on which callback mechanism should be used for which cases. | |
- for UIView and UIVC, use delegate | |
- for model change, use NSNotification or KVO. However, KVO is not designed for communicating "events", therefore NSNotif is the preferred. | |
- for Data Access, use block. | |
for UIControl subclass, use target-action. | |
Bye Delegate, Hello Block |